pub trait IsMesh<'a, T: IsPoint, N: IsUnitVector>:
GeometricPrimitive
+ HasVertices<'a, Vertex = T>
+ HasFaces<'a, Point = T, Normal = N>
+ HasEdges{
// 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§
Sourcefn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>
fn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>
Returns the ordered face-table ids that participate in this mesh.
Sourcefn set_face_id(
&mut self,
index: usize,
face_id: FaceId,
) -> Result<(), ErrorsJSL>
fn set_face_id( &mut self, index: usize, face_id: FaceId, ) -> Result<(), ErrorsJSL>
Replaces the face-table id at the given mesh face position.
Sourcefn surface_area(&self) -> GeometryMeasure
fn surface_area(&self) -> GeometryMeasure
Returns the total surface area of the mesh.
Provided Methods§
Sourcefn face_count(&self) -> usize
fn face_count(&self) -> usize
Returns the number of faces in the mesh.
Sourcefn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>
fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>
Resolves and returns a face by mesh-local position.
Sourcefn face_normal(&self, index: usize) -> Option<N>
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".