form.measure
Whether a mesh is closed, the shape of each edge, and each face’s planarity and area, every answer with its evidence class.
Usage
Form.measure(geometry: VerbInput, options?: FormMeasureOptions): Result<FormMeasure>Parameters
geometryGeometry | VerbValueA polygon mesh with a vec3 f64 P.
options.facts('closed' | 'edges' | 'planar' | 'area' | 'repeats' | 'mirrors')[]The facts asked for; repeats and mirrors are searches, asked for by name. Default
all but repeats and mirrors.options.epsnumberrepeats: the most false alarms a meaningful group may expect. Default
1. In count.options.angleTolerancenumberrepeats: how far normals may turn and still face the same way. Default
1e-9. In radians.options.tolerancenumberA fraction of the bounding-box diagonal, used only where the exact answer is no. Default
1e-9. In ratio.options.offsetnumberThe first face listed. Default
0. In count.options.limitnumberAt most this many faces, 1–1000. Default
100. In count.
Returns
Ok with { diagonal, tolerance, closed?, edges?, repeats?, faces }: closed and edge shapes are exact; a face is planar exactly, or within the tolerance with the deviation measured; repeats are groups of faces one translation maps onto each other and mirrors groups one plane swaps, both scored a-contrario (NFA ≤ eps).
Errors
Guarantees
- an exact answer comes from exact predicates on the f64 input and never depends on a tolerance
- edge convexity assumes outward winding: below the face at the edge is convex
- The same result on every machine.
Example
Form.measure(Mesh.box().value) // → a closed box with 12 convex edges once loadGeometryKernel() has run