Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.algorithms.unstructured_mesh.extrude

Mesh extrusion algorithms.

Functions

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
  • mesh UnstructuredMesh — The mesh to extrude.
  • offsets npt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)
  • scale typing.Optional[npt.NDArray] — scaling factor for each extruded copy, relative to the center, shape is (nextrude,)
  • rotation typing.Optional[npt.NDArray] — rotation of each extruded copy in terms of euler angles relative to the center, shape is (nextrude, 3)
  • center typing.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()

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
  • mesh UnstructuredMesh — The mesh to extrude.
  • side_set str — name of the side set
  • offsets npt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)
  • scale typing.Optional[npt.NDArray] — scaling factor for each extruded copy, relative to the center, shape is (nextrude,)
  • rotation typing.Optional[npt.NDArray] — rotation of each extruded copy in terms of euler angles relative to the center, shape is (nextrude, 3)
  • center typing.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()

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
  • mesh UnstructuredMesh — The mesh to extrude.
  • side_set str — name of the side set
  • offsets npt.NDArray — offsets, either in the new dimension or all 3 dimension, shape is (nextrude, ) or (nextrude, 3)
  • direction typing.Optional[str] — Optional axis of extrusion if offsets is a one-dimensional array. Must be x or y.
Returns UnstructuredMesh