Expand description
Whole-model consistency checks. Each check lives in its own file, one
check per file. Every check function takes (params, errors, model) and pushes
its own violations onto errors rather than returning on the first one,
so validate always runs every check and reports everything wrong in
one pass.
Modules§
Structs§
- Inward
- Where and how a normal was found pointing in (see
Outward::No). - Validation
Parameters - Shared tuning knobs for the whole-model validation checks — how many points to sample along a curve, and the budgets passed down to the underlying BFS/DFS geometric searches.
Enums§
- Outward
- Whether a face’s normal points out of its solid, as
normal_points_outwardfound it.
Functions§
- body_
crossing - An edge of the bodies
bodiesthat crosses the trimmed region of one of their faces away from every vertex, with where: a body running into itself or into another.Noneif no edge does — which does not rule out two faces crossing along a curve no edge of either reaches. - edge_
crosses_ face - Where the edge
edge_idcrosses the trimmed region of the faceface_id, away from every vertex, if it does — never for an edge that bounds the face (see [check_edges_and_faces_consistent]). - normal_
points_ outward - Whether the normal of face
face_idof shellshell_idpoints out of the solidsolid_id—Nonefor a face without an interior point, whichcheck_faces_have_interiorreports, or without one clear of the rest of the solid’s boundary. - validate
- validate_
fast - A cheap subset of
validate: only the checks that are purely structural/combinatorial (pointer validity, two-waynext/prev/backref consistency, pcurve loop continuity) or a single pass over already-stored geometry (vertices vs. their edges’/faces’ curves/surfaces) — none of theO(n^2)pairwise numerical-intersection searches (disjointness_check,face_face_numerical_intersection) or the sampling-basedcurve_and_surface_sampling_check. Meant for call sites that want a quick “is this model still well-formed” check after every mutating step (e.g. a test sweeping many scenes) without paying for the searches that dominatevalidate’s cost. - validate_
manifold validateplus two extra whole-model sanity checks that go beyond per-entity consistency: every edge is shared by coedges paired up, as many each way (see [check_every_edge_has_paired_coedges]), and — the check that actually exercises that strategy — every shell classifies a batch of random points identically no matter which (non-degenerate) random ray direction was used to test them.