Skip to main content

IsMesh

Trait IsMesh 

Source
pub trait IsMesh<'a, T: IsPoint, N: IsUnitVector>:
    GeometricPrimitive
    + HasVertices<'a, Vertex = T>
    + HasFaces<'a, Point = T, Normal = N>
    + HasEdges
where <Self as HasEdges>::Edge: IsLine<'a, T>,
{ // Required methods fn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>; fn set_face_id( &mut self, index: usize, face_id: FaceId, ) -> Result<(), ErrorsJSL>; fn surface_area(&self) -> GeometryMeasure; // Provided methods fn face_count(&self) -> usize { ... } fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face> { ... } fn face_normal(&self, index: usize) -> Option<N> { ... } }
Expand description

A surface mesh primitive with stored vertices and polygonal boundary faces.

This trait is explicitly for surface meshes rather than volumetric cell meshes. The current surface-mesh model assumes vertices are the primary stored table. Faces and edges may be backed by separate structures internally, but they are exposed through semantic mesh accessors rather than through the older generic single-table pattern.

Required Methods§

Source

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

Returns the ordered face-table ids that participate in this mesh.

Source

fn set_face_id( &mut self, index: usize, face_id: FaceId, ) -> Result<(), ErrorsJSL>

Replaces the face-table id at the given mesh face position.

Source

fn surface_area(&self) -> GeometryMeasure

Returns the total surface area of the mesh.

Provided Methods§

Source

fn face_count(&self) -> usize

Returns the number of faces in the mesh.

Source

fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>

Resolves and returns a face by mesh-local position.

Source

fn face_normal(&self, index: usize) -> Option<N>

Returns the normal associated with a face, if present.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§