mymesh.primitives.Revolve#
- mymesh.primitives.Revolve(m, angle, anglestep, center=[0, 0, 0], shift=0, axis=2, ElemType=None)[source]#
Revolve a 2D mesh to a 3D surface or volume
- Parameters:
m (mymesh.mesh) – Mesh object of 2d line mesh or 2d surface mesh
angle (scalar) – Angle (in radians) to revolve the line by. For a full rotation, angle=2*np.pi
anglestep (scalar) – Step size (in radians) at which to sample the revolution.
center (array_like, optional) – Three element vector denoting the center of revolution (i.e. a point on the axis), by default [0,0,0]
axis (int or array_like, optional) – Axis of revolution. This can be specified as either 0 (x), 1 (y), or 2 (z) or a three element vector denoting the axis, by default 2.
shift (float, optional) – Offset along axis between the initial and final steps of the rotation, by default 0.
ElemType (str, optional) – Specify the element type of the revolved mesh. If the input is a line mesh (m.Type=’line’), the element type can be None or ‘tri’; if the input is a 2D surface (m.Type=’surf’), the element type can be None or ‘tet’. If ‘tri’ or ‘tet’, the mesh will be converted to a purely triangular/ tetrahedral mesh, otherwise it will follow from the input mesh (input line meshes will get quad or quad-dominant meshes, input surf meshes could get hexahedral, or wedge-dominant meshes and may also contain pyramids or tetrahedra). By default, None.
- Returns:
revolve – Mesh object containing the revolved mesh.
- Return type:
Note
Due to the ability to unpack the mesh object to NodeCoords and NodeConn, the NodeCoords and NodeConn array can be returned directly (instead of the mesh object) by running:
NodeCoords, NodeConn = primitives.Revolve(...)