Skip to main content

analyze

Function analyze 

Source
pub fn analyze(mesh: &Mesh, options: &AnalyzeOptions<'_>) -> Result<Analysis>
Expand description

Reports the defects of mesh without changing it.

  • Loops, components, edge kinds, pinch vertices and orientation conflicts are computed from the triangles with three distinct vertex ids; the others are skipped there, as everywhere in this crate.
  • Coincident vertices: groups of alive vertices linked through pairs at most weld_tolerance apart, as a weld would merge them.
  • Degenerate triangles: a repeated vertex id, or an area of at most 1e-12 times the longest edge squared.
  • Duplicate triangles: every alive triangle but the smallest id of each set of triangles on the same three vertex ids, in any order or winding.
  • Non-manifold vertices are the ends of non-manifold edges. Pinch vertices, whose fan splits into pieces (the corner where two holes touch), are listed apart.
  • Orientation conflicts: interior edges whose two triangles both run along them in the same direction.
  • Self-intersection (self_intersects): two alive triangles that share no vertex id, neither degenerate, intersect or touch. Pairs sharing a vertex are not tested.

The lists with a count beside them (coincident, degenerate_list, duplicate_list and non_manifold_edge_list) keep their first options.max_listed entries; the counts and the other lists are complete.

ยงErrors

OpsError::InvalidInput when weld_tolerance is negative, NaN or infinite; OpsError::Query when the BVH does not match the mesh; and OpsError::Store with StoreError::OutOfMemory when a temporary cannot grow.