Position and index buffers to measure.
Optionaloptions: IAutoMovieMeasureMeshDefects.IOptions
weld is the lattice's cells per unit of length, default MESH_WELD_GRID. sliver is the aspect limit above which a triangle is a sliver; absent, no sliver is reported.
The defects, empty for a closed, consistently wound mesh without degenerate triangles.
List every defect of a triangle mesh with the vertices that carry it, so an inspection can draw each one where it is instead of reading a count.
positionsis flat xyz in any one length unit andindicesholds triangle corners, or isnullfor a non-indexed list whose every three vertices are one triangle. Both are read in place, typed arrays included, and neither is changed. Vertices weld by position: each coordinate is multiplied byoptions.weld, the number of lattice cells per unit of length, and rounded to the nearest whole cell, and vertices in the same cell on all three axes are one corner. The default isMESH_WELD_GRID, a nanometre grid when the unit is the metre. Welding by cell is not welding by distance: two points closer than a cell that fall on either side of a rounding boundary stay apart.A triangle whose corners weld onto fewer than three cells is
degenerateand contributes no edges. Every other triangle contributes its three edges between welded corners. An edge used by exactly one triangle isopen, by more than twonon-manifold, and by exactly two that traverse it in the same directioninconsistent, which is also what a triangle stored twice reports on all three edges. A non-manifold edge is not tested for winding.sliveris reported only whenoptions.sliveris given: a triangle on three distinct cells whose aspect, its longest edge squared divided by twice its area, exceeds that limit. The aspect is dimensionless and equals the longest edge over the height standing on it:2 / sqrt(3)for an equilateral triangle, 2 for a right isosceles one, and infinite for collinear corners on distinct cells. It is measured on the stored positions, not on the lattice.Defects come in ascending order of the first triangle that carries them. Within one triangle its own
degenerateorsliverdefect comes first, then its edges in corner order: corner 0 to 1, 1 to 2, 2 to 0. An edge is listed once, at the first triangle that uses it. The same input always gives the same list.It throws a named
Errorfor a position count not divisible by three, a corner count not divisible by three, an index that is not a whole number inside the position buffer, aweldorsliverthat is not positive and finite, a vertex whose lattice coordinate is not finite, and more than 94 906 265 vertices. Only edge incidence is measured: a vertex where two fans touch and surfaces that cross each other are not found here.