CSPrimRotPoly
- class CSXCAD.CSPrimitives.CSPrimRotPoly
Bases:
CSPrimPolygon
Rotation Extruded Polygon
A rotation extruded polygon is a polygon that is rotated around a Cartesian axis with a given start and stop angle.
- Parameters:
- rot_axisfloat or str
Rotation axis direction, either 0,1,2 or x/y/z respectively.
- anglefloat, float
Start/Stop angle (rad) of rotation. Default is (0, 2*pi).
Examples
Define a half circle on the xy-plane, rotated around the x axis
>>> rotpoly = CSPrimitives.CSPrimRotPoly(pset, metal, norm_dir='z') >>> ang = np.linspace(0, np.pi, 21) >>> rotpoly.SetCoords(5*np.cos(ang), 5*np.sin(ang)) >>> rotpoly.SetRotAxisDir('x')
- GetAngle()
Get the start/stop angle (rad) of rotation.
- Returns a0, a1:
float, float – Start/Stop angle (rad) of rotation.
- GetRotAxisDir()
Get the rotation axis direction
- Returns ny:
int – Rotation axis direction as 0, 1 or 2 meaning x,y or z
- SetAngle(a0, a1)
Set the start/stop angle (rad) of rotation. Default is (0, 2*pi).
- Parameters:
a0 – float – Start angle (rad) of rotation.
a1 – float – Stop angle (rad) of rotation.
- SetRotAxisDir(ny)
Set the rotation axis direction, either 0,1,2 or x/y/z respectively.
- Parameters:
ny – int or str – Rotation axis direction, either 0,1,2 or x/y/z respectively.