salvus.mesh.algorithms.unstructured_mesh.extrude
Mesh extrusion algorithms.
Functions
extrude()
extrude()def extrude(
mesh: UnstructuredMesh,
offsets: npt.NDArray,
scale: typing.Optional[npt.NDArray] = None,
rotation: typing.Optional[npt.NDArray] = None,
center: typing.Optional[npt.NDArray] = None,
) -> UnstructuredMesh: ...Extrude a 2D mesh to create a 3D mesh.
Each extruded 2D mesh can be offset, scaled and rotated copies of the original.
Parameters
meshUnstructuredMesh — The mesh to extrude.offsetsnpt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)scaletyping.Optional[npt.NDArray] — scaling factor for each extruded copy, relative to the center, shape is (nextrude,)rotationtyping.Optional[npt.NDArray] — rotation of each extruded copy in terms of euler angles relative to the center, shape is (nextrude, 3)centertyping.Optional[npt.NDArray] — center coordinates for rotation, defaults to the center of mass of the original 2D mesh, shape is (3,)
Returns UnstructuredMesh
extrude_side_set()
extrude_side_set()def extrude_side_set(
mesh: UnstructuredMesh,
side_set: str,
offsets: npt.NDArray,
scale: typing.Optional[npt.NDArray] = None,
rotation: typing.Optional[npt.NDArray] = None,
center: typing.Optional[npt.NDArray] = None,
) -> UnstructuredMesh: ...Extrude a side set to add new elements to the mesh.
Parameters
meshUnstructuredMesh — The mesh to extrude.side_setstr — name of the side setoffsetsnpt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)scaletyping.Optional[npt.NDArray] — scaling factor for each extruded copy, relative to the center, shape is (nextrude,)rotationtyping.Optional[npt.NDArray] — rotation of each extruded copy in terms of euler angles relative to the center, shape is (nextrude, 3)centertyping.Optional[npt.NDArray] — center coordinates for rotation, defaults to the center of mass of the original 2D mesh, shape is (3,)
Returns UnstructuredMesh
extrude_side_set_2D()
extrude_side_set_2D()def extrude_side_set_2D(
mesh: UnstructuredMesh,
side_set: str,
offsets: npt.NDArray,
direction: typing.Optional[str] = None,
) -> UnstructuredMesh: ...Extrude a side set of a 2D mesh and append new elements.
Currently, the functionality is limited to cartesian meshes with side sets that are aligned with the coordinate axis.
Parameters
meshUnstructuredMesh — The mesh to extrude.side_setstr — name of the side setoffsetsnpt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)directiontyping.Optional[str] — Optional axis of extrusion ifoffsetsis a one-dimensional array. Must bexory.
Returns UnstructuredMesh