-
Notifications
You must be signed in to change notification settings - Fork 0
/
rotate_extrude_1.as
27 lines (21 loc) · 896 Bytes
/
rotate_extrude_1.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// AngelCAD sample: rotate_extrude_1.as
// Illustrate rotate extrude operation, creating 3d object from 2d shape
shape@ main_shape()
{
// rotate extrude takes a 2d shape lying in the xy-plane
// and rotates it around the global Y-axis.
// Note that a positive rotation angle is is here CCW
// as seen from a position on the negative y-axis
// to perform a meaningful rotate_extrude, the profile must first
// be translated so that it is entirely on the positive x-axis
// rotation angles can be specified in degrees (deg:) or radians (rad:)
// if the angle specifies more than a full circle (and the pitch is zero),
// the result will be a torus.
shape2d@ profile = translate(100,0)*square(25);
return scale(0.25)*rotate_extrude(profile,deg:135);
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:-1.0);
}