pub struct VolumeMesh3D { /* private fields */ }Expand description
Concrete 3D tetrahedral volume mesh implementation backed by tetrahedron ids.
Implementations§
Source§impl VolumeMesh3D
impl VolumeMesh3D
Sourcepub fn new(
tetrahedron_ids: Vec<TetrahedronId>,
vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>,
tetrahedron_table: SharedGeometryTable<TetrahedronId, Tetrahedron3D>,
) -> Self
pub fn new( tetrahedron_ids: Vec<TetrahedronId>, vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>, tetrahedron_table: SharedGeometryTable<TetrahedronId, Tetrahedron3D>, ) -> Self
Creates a volume mesh from ordered tetrahedron ids and shared point/tetrahedron tables.
Each tetrahedron id is resolved through tetrahedron_table, and the tetrahedra in that
table in turn resolve their vertices through vertex_table.
Sourcepub fn from_tetrahedra(
tetrahedra: Vec<Tetrahedron3D>,
) -> Result<Self, ErrorsJSL>
pub fn from_tetrahedra( tetrahedra: Vec<Tetrahedron3D>, ) -> Result<Self, ErrorsJSL>
Creates a volume mesh from tetrahedra, inferring the shared point table and building a dedicated tetrahedron table with sequential ids.
Sourcepub fn tetrahedra(&self) -> Vec<Tetrahedron3D>
pub fn tetrahedra(&self) -> Vec<Tetrahedron3D>
Resolves and returns all tetrahedra in mesh order.
Sourcepub fn tetrahedron_count(&self) -> usize
pub fn tetrahedron_count(&self) -> usize
Returns the number of tetrahedra in the mesh.
Sourcepub fn tetrahedron(&self, index: usize) -> Option<Tetrahedron3D>
pub fn tetrahedron(&self, index: usize) -> Option<Tetrahedron3D>
Resolves and returns a tetrahedron by mesh-local index.
Sourcepub fn volume(&self) -> GeometryMeasure
pub fn volume(&self) -> GeometryMeasure
Returns the total enclosed volume of the mesh.
Sourcepub fn surface_area(&self) -> GeometryMeasure
pub fn surface_area(&self) -> GeometryMeasure
Returns the total boundary surface area of the mesh.
Sourcepub fn boundary_triangles(&self) -> Vec<Triangle3D>
pub fn boundary_triangles(&self) -> Vec<Triangle3D>
Returns the boundary triangles exposed by the tetrahedral cells.
Sourcepub fn boundary_faces(&self) -> Vec<PolygonFace3D>
pub fn boundary_faces(&self) -> Vec<PolygonFace3D>
Returns the boundary faces as polygon-face wrappers over the boundary triangles.
Sourcepub fn surface_mesh(
&self,
face_table: SharedGeometryTable<FaceId, PolygonFace3D>,
) -> Result<SurfaceMesh3D, ErrorsJSL>
pub fn surface_mesh( &self, face_table: SharedGeometryTable<FaceId, PolygonFace3D>, ) -> Result<SurfaceMesh3D, ErrorsJSL>
Materializes the boundary surface into a shared face table and returns a connected surface mesh.
Trait Implementations§
Source§impl CanMirror for VolumeMesh3D
impl CanMirror for VolumeMesh3D
Source§impl CanRotate for VolumeMesh3D
impl CanRotate for VolumeMesh3D
Source§impl CanShear for VolumeMesh3D
impl CanShear for VolumeMesh3D
Source§impl CanTranslate for VolumeMesh3D
impl CanTranslate for VolumeMesh3D
Source§impl Canonicalize for VolumeMesh3D
impl Canonicalize for VolumeMesh3D
Source§fn canonicalize(&mut self)
fn canonicalize(&mut self)
Source§impl Clone for VolumeMesh3D
impl Clone for VolumeMesh3D
Source§impl Debug for VolumeMesh3D
impl Debug for VolumeMesh3D
Source§impl Display for VolumeMesh3D
impl Display for VolumeMesh3D
impl Eq for VolumeMesh3D
impl GeometricPrimitive for VolumeMesh3D
impl GeometricPrimitive3D for VolumeMesh3D
Source§impl HasCentroid for VolumeMesh3D
impl HasCentroid for VolumeMesh3D
Source§impl HasEdges for VolumeMesh3D
impl HasEdges for VolumeMesh3D
Source§impl<'a> HasTetrahedra<'a> for VolumeMesh3D
impl<'a> HasTetrahedra<'a> for VolumeMesh3D
Source§type Point = CoordinateVector3D
type Point = CoordinateVector3D
Source§type Normal = UnitVector3D
type Normal = UnitVector3D
Source§type Tetrahedron = Tetrahedron3D
type Tetrahedron = Tetrahedron3D
Source§type TetrahedronTable = Rc<RefCell<HashGeometryTable<TetrahedronId, Tetrahedron3D>>>
type TetrahedronTable = Rc<RefCell<HashGeometryTable<TetrahedronId, Tetrahedron3D>>>
Source§fn tetrahedron_table(&self) -> &Self::TetrahedronTable
fn tetrahedron_table(&self) -> &Self::TetrahedronTable
Source§fn tetrahedron_table_mut(&mut self) -> &mut Self::TetrahedronTable
fn tetrahedron_table_mut(&mut self) -> &mut Self::TetrahedronTable
Source§fn set_tetrahedron_table(&mut self, table: &'a mut Self::TetrahedronTable)
fn set_tetrahedron_table(&mut self, table: &'a mut Self::TetrahedronTable)
Source§fn tetrahedron_table_size(&self) -> usize
fn tetrahedron_table_size(&self) -> usize
Source§fn get_tetrahedron(&self, id: &TetrahedronId) -> Option<Self::Tetrahedron>
fn get_tetrahedron(&self, id: &TetrahedronId) -> Option<Self::Tetrahedron>
id.Source§fn contains_tetrahedron(&self, id: &TetrahedronId) -> bool
fn contains_tetrahedron(&self, id: &TetrahedronId) -> bool
true if the tetrahedron table contains id.Source§fn insert_tetrahedron(
&mut self,
id: TetrahedronId,
value: Self::Tetrahedron,
) -> Result<(), ErrorsJSL>
fn insert_tetrahedron( &mut self, id: TetrahedronId, value: Self::Tetrahedron, ) -> Result<(), ErrorsJSL>
id.Source§fn remove_tetrahedron(
&mut self,
id: &TetrahedronId,
) -> Option<Self::Tetrahedron>
fn remove_tetrahedron( &mut self, id: &TetrahedronId, ) -> Option<Self::Tetrahedron>
id, if present.Source§impl<'a> HasVertices<'a> for VolumeMesh3D
impl<'a> HasVertices<'a> for VolumeMesh3D
Source§type Vertex = CoordinateVector3D
type Vertex = CoordinateVector3D
Source§type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
Source§fn vertex_table(&self) -> &Self::VertexTable
fn vertex_table(&self) -> &Self::VertexTable
Source§fn vertex_table_mut(&mut self) -> &mut Self::VertexTable
fn vertex_table_mut(&mut self) -> &mut Self::VertexTable
Source§fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)
fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)
Source§fn vertex_table_size(&self) -> usize
fn vertex_table_size(&self) -> usize
Source§fn contains_vertex(&self, id: &PointId) -> bool
fn contains_vertex(&self, id: &PointId) -> bool
true if the vertex table contains id.