mesh.Mesh.extrude#
- Mesh.extrude(div=1, dir=0, length=1.0, degree=1, fix=True, eltype=None)#
Extrude a Mesh along a straight line.
The Mesh is extruded over a given length in the given direction.
Parameters#
- div: smartseed
Specifies how the extruded direction will be subdivided in elements. It can be anything that is acceptable as input for
smartSeed().- dir: int (0,1,2) or float array_like (3,)
The direction of the extrusion: either a global axis number (0 (X-axis), 1 (Y-axis) and 2 (Z-axis)) or a direction vector.
- length: float
The length of the extrusion, measured along the direction
dir.- degree: int
The degree of the connection. Currently only degree 1 and 2 are supported.
- 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 or
ElementType, optional The element type of the constructed hypermesh. Normally, this is set automatically from the base element type and the connection degree. If a different element type is specified, a final conversion to the requested element type is attempted (using
convert()).
Returns#
- Mesh
A Mesh obtained by extruding the input Mesh over the given
lengthin directiondir, subdividing this length according to the seeds generated bysmartSeed(div).
See Also#
sweep(): extrusion along a general pathExamples#
>>> M = Mesh(eltype='line3').extrude(1, dir=1, length=1.0, degree=2) >>> print(M) Mesh: n_nodes: 9, n_elems: 1, plexitude: 9, level: 2, eltype: quad9 BBox: [0. 0. 0.], [1. 1. 0.] Size: [1. 1. 0.] Length: 4.0 Area: 1.0