pub struct Mesh {
pub vertices: Vec<Vec3>,
pub triangles: Vec<[u32; 3]>,
pub vertex_normals: Option<Vec<Vec3>>,
pub source_metadata: Vec<SourceMetadata>,
}Expand description
An indexed triangle mesh and optional recognition metadata.
Fields§
§vertices: Vec<Vec3>Vertex positions in model coordinates.
triangles: Vec<[u32; 3]>Triangle vertex indices; winding defines the geometric normal.
vertex_normals: Option<Vec<Vec3>>Optional unit-normal hints, one per vertex. These improve curved-surface fitting without replacing triangle winding as the topology authority.
source_metadata: Vec<SourceMetadata>Versioned metadata associated with subsets of triangles.
Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn new(vertices: Vec<Vec3>, triangles: Vec<[u32; 3]>) -> Self
pub fn new(vertices: Vec<Vec3>, triangles: Vec<[u32; 3]>) -> Self
Creates a mesh without vertex-normal hints or source metadata.
Sourcepub fn with_vertex_normals(self, normals: Vec<Vec3>) -> Self
pub fn with_vertex_normals(self, normals: Vec<Vec3>) -> Self
Attach per-vertex normal hints. Length and values are validated by
Mesh::analyze, where finite non-zero vectors are normalized.
Sourcepub fn analyze(
&self,
options: &MeshAnalysisOptions,
) -> Result<AnalyzedMesh, RecognitionError>
pub fn analyze( &self, options: &MeshAnalysisOptions, ) -> Result<AnalyzedMesh, RecognitionError>
Validates the mesh and computes geometry and adjacency information.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mesh
impl<'de> Deserialize<'de> for Mesh
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Mesh
Auto Trait Implementations§
impl Freeze for Mesh
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnsafeUnpin for Mesh
impl UnwindSafe for Mesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more