Skip to main content

VolumeMesh3D

Struct VolumeMesh3D 

Source
pub struct VolumeMesh3D { /* private fields */ }
Expand description

Concrete 3D tetrahedral volume mesh implementation backed by tetrahedron ids.

Implementations§

Source§

impl VolumeMesh3D

Source

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.

Source

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.

Source

pub fn tetrahedra(&self) -> Vec<Tetrahedron3D>

Resolves and returns all tetrahedra in mesh order.

Source

pub fn tetrahedron_count(&self) -> usize

Returns the number of tetrahedra in the mesh.

Source

pub fn tetrahedron(&self, index: usize) -> Option<Tetrahedron3D>

Resolves and returns a tetrahedron by mesh-local index.

Source

pub fn volume(&self) -> GeometryMeasure

Returns the total enclosed volume of the mesh.

Source

pub fn surface_area(&self) -> GeometryMeasure

Returns the total boundary surface area of the mesh.

Source

pub fn boundary_triangles(&self) -> Vec<Triangle3D>

Returns the boundary triangles exposed by the tetrahedral cells.

Source

pub fn boundary_faces(&self) -> Vec<PolygonFace3D>

Returns the boundary faces as polygon-face wrappers over the boundary triangles.

Source

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

Source§

type Point = CoordinateVector3D

Point type used by the mirror plane.
Source§

type Normal = UnitVector3D

Unit normal type used by the mirror plane.
Source§

fn mirror<P>(&mut self, mirror_plane: &P)
where P: IsPlane<Point = Self::Point, Normal = Self::Normal>,

Reflects self across mirror_plane.
Source§

impl CanRotate for VolumeMesh3D

Source§

type Point = CoordinateVector3D

Point type used by the rotation axis.
Source§

fn rotate<'a, L>(&mut self, axis: &L, angle_radians: GeometryMeasure)
where L: IsLine<'a, Self::Point>,

Mutates self by rotating about axis.
Source§

impl CanShear for VolumeMesh3D

Source§

type Point = CoordinateVector3D

Point type used by the shear line.
Source§

fn shear<'a, L>(&mut self, shear_line: &L)
where L: IsLine<'a, Self::Point>,

Mutates self by the shear x ← x + k·y, with k = shear_line.length().
Source§

impl CanTranslate for VolumeMesh3D

Source§

type Point = CoordinateVector3D

Point type used by the translation line.
Source§

fn translate<'a, L>(&mut self, translation_vector: &L)
where L: IsLine<'a, Self::Point>,

Mutates self by applying the translation vector.
Source§

impl Canonicalize for VolumeMesh3D

Source§

fn canonicalize(&mut self)

Converts the primitive to a canonical representation.
Source§

impl Clone for VolumeMesh3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VolumeMesh3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VolumeMesh3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for VolumeMesh3D

Source§

impl GeometricPrimitive for VolumeMesh3D

Source§

impl GeometricPrimitive3D for VolumeMesh3D

Source§

impl HasCentroid for VolumeMesh3D

Source§

type Point = CoordinateVector3D

Point type used to represent the centroid.
Source§

fn centroid(&self) -> Self::Point

Returns the centroid.
Source§

impl HasEdges for VolumeMesh3D

Source§

type Edge = Line3D

Edge type returned by the implementor.
Source§

fn edge_count(&self) -> usize

Number of edges available on the shape.
Source§

fn edge(&self, index: usize) -> Option<Self::Edge>

Returns an edge by index.
Source§

impl<'a> HasTetrahedra<'a> for VolumeMesh3D

Source§

type Point = CoordinateVector3D

Point primitive referenced by the stored tetrahedra.
Source§

type Normal = UnitVector3D

Unit normal type used by the stored tetrahedra.
Source§

type Tetrahedron = Tetrahedron3D

Tetrahedron primitive stored in the tetrahedron table.
Source§

type TetrahedronTable = Rc<RefCell<HashGeometryTable<TetrahedronId, Tetrahedron3D>>>

Borrowed tetrahedron-table type.
Source§

fn tetrahedron_table(&self) -> &Self::TetrahedronTable

Returns an immutable reference to the tetrahedron table.
Source§

fn tetrahedron_table_mut(&mut self) -> &mut Self::TetrahedronTable

Returns a mutable reference to the tetrahedron table.
Source§

fn set_tetrahedron_table(&mut self, table: &'a mut Self::TetrahedronTable)

Rebinds the implementor to a different borrowed tetrahedron table.
Source§

fn tetrahedron_table_size(&self) -> usize

Returns the number of entries in the tetrahedron table.
Source§

fn get_tetrahedron(&self, id: &TetrahedronId) -> Option<Self::Tetrahedron>

Returns the tetrahedron stored at id.
Source§

fn contains_tetrahedron(&self, id: &TetrahedronId) -> bool

Returns true if the tetrahedron table contains id.
Source§

fn insert_tetrahedron( &mut self, id: TetrahedronId, value: Self::Tetrahedron, ) -> Result<(), ErrorsJSL>

Inserts or replaces the tetrahedron stored at id.
Source§

fn remove_tetrahedron( &mut self, id: &TetrahedronId, ) -> Option<Self::Tetrahedron>

Removes and returns the tetrahedron stored at id, if present.
Source§

impl<'a> HasVertices<'a> for VolumeMesh3D

Source§

type Vertex = CoordinateVector3D

Point primitive stored in the vertex table.
Source§

type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>

Borrowed point-table type.
Source§

fn vertex_table(&self) -> &Self::VertexTable

Returns an immutable reference to the vertex table.
Source§

fn vertex_table_mut(&mut self) -> &mut Self::VertexTable

Returns a mutable reference to the vertex table.
Source§

fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)

Rebinds the implementor to a different borrowed vertex table.
Source§

fn vertex_table_size(&self) -> usize

Returns the number of entries in the vertex table.
Source§

fn get_vertex(&self, id: &PointId) -> Option<Self::Vertex>

Returns the vertex stored at id.
Source§

fn contains_vertex(&self, id: &PointId) -> bool

Returns true if the vertex table contains id.
Source§

fn insert_vertex( &mut self, id: PointId, value: Self::Vertex, ) -> Result<(), ErrorsJSL>

Inserts or replaces the vertex stored at id.
Source§

fn remove_vertex(&mut self, id: &PointId) -> Option<Self::Vertex>

Removes and returns the vertex stored at id, if present.
Source§

impl Hash for VolumeMesh3D

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IsValid for VolumeMesh3D

Source§

fn is_valid(&self) -> bool

Returns true when the primitive is valid.
Source§

impl<'a> IsVolumeMesh<'a, CoordinateVector3D, UnitVector3D> for VolumeMesh3D

Source§

fn tetrahedron_ids(&self) -> Box<dyn Iterator<Item = TetrahedronId> + '_>

Returns the ordered tetrahedron-table ids that participate in this mesh.
Source§

fn set_tetrahedron_id( &mut self, index: usize, tetrahedron_id: TetrahedronId, ) -> Result<(), ErrorsJSL>

Replaces the tetrahedron-table id at the given mesh cell position.
Source§

fn volume(&self) -> GeometryMeasure

Returns the total enclosed volume of the mesh.
Source§

fn tetrahedron_count(&self) -> usize

Returns the number of tetrahedra in the mesh.
Source§

fn tetrahedron( &self, index: usize, ) -> Option<<Self as HasTetrahedra<'a>>::Tetrahedron>

Resolves and returns a tetrahedron by mesh-local position.
Source§

impl PartialEq for VolumeMesh3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Repair for VolumeMesh3D

Source§

fn repair(&mut self) -> Result<(), ErrorsJSL>

Repairs the primitive or returns an error.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSerialize for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.