mesh.Mesh.revolve#
- Mesh.revolve(n, axis=0, angle=360.0, around=None, fuse=True, fix=True, eltype=None)#
Revolve a Mesh around an axis.
Revolving a Mesh extrudes the Mesh along a circular path.
Parameters#
- n: int
Number of circumferential steps
- axis: int (0,1,2) or float array_like (3,)
The direction of the rotation axis: either one of 0 (X-axis), 1 (Y-axis), 2 (Z-axis) for a global axis, or a vector with 3 components for a general direction.
- angle: float
The total angle (in degrees) of the revolve operation.
- around: float array_like (3,)
If provided, it specifies a point on the rotation axis. If not, the rotation axis goes through the origin of the global axes.
- fix: bool
If True (default), elements with negative volumes are automatically corrected after connecting the meshes. This is done by calling
fix_volumes(), which reverses the orientation of elements that have negative volume to ensure positive volume.- eltype: str of
ElementType, optional. The final element type. If specified, and it does not match the natural extruded element type, a final conversion to this target type will be attempted.
- fuse: bool
If True, the resulting Mesh will be fused.
Returns#
- Mesh
A Mesh obtained by revolving the given Mesh over an angle around an axis in n steps, while extruding the mesh from one step to the next. This extrudes points into lines, lines into surfaces and surfaces into volumes.
See Also#
sweep(): extrusion along a general pathExamples#
>>> M = Mesh(eltype='line2').translate([2.0,0.0,0.0]) >>> quad = M.revolve(4, axis=2, angle=360.0) >>> print(quad.report(full=True)) Mesh: n_nodes: 8, n_elems: 4, plexitude: 4, level: 2, eltype: quad4 BBox: [-3. -3. 0.], [3. 3. 0.] Size: [6. 6. 0.] Length: 28.28 Area: 10.0 Coords: [[ 2. 0. 0.] [ 3. 0. 0.] [ 0. 2. 0.] [ 0. 3. 0.] [-2. 0. 0.] [-3. 0. 0.] [ 0. -2. 0.] [ 0. -3. 0.]] Elems: [[0 1 3 2] [2 3 5 4] [4 5 7 6] [6 7 1 0]]