Skip to main content

Module validation

Module validation 

Source
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§

numerical_accuracy

Structs§

Inward
Where and how a normal was found pointing in (see Outward::No).
ValidationParameters
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_outward found it.

Functions§

body_crossing
An edge of the bodies bodies that crosses the trimmed region of one of their faces away from every vertex, with where: a body running into itself or into another. None if 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_id crosses the trimmed region of the face face_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_id of shell shell_id points out of the solid solid_id — None for a face without an interior point, which check_faces_have_interior reports, 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-way next/prev/backref consistency, pcurve loop continuity) or a single pass over already-stored geometry (vertices vs. their edges’/faces’ curves/surfaces) — none of the O(n^2) pairwise numerical-intersection searches (disjointness_check, face_face_numerical_intersection) or the sampling-based curve_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 dominate validate’s cost.
validate_manifold
validate plus 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.