pub struct BrepSolid {
pub mass_properties_cache: MassPropertiesCache,
pub id: u64,
pub vertices: Vec<VertexRecord>,
pub edges: Vec<EdgeRecord>,
pub shells: Vec<ShellRecord>,
pub genus: i64,
pub kind: BodyKind,
pub cells: Vec<CellRecord>,
}Fields§
§mass_properties_cache: MassPropertiesCacheContent-checked measurements; cloned with this solid, never serialized.
Initialize with Default::default() when constructing a solid.
id: u64§vertices: Vec<VertexRecord>§edges: Vec<EdgeRecord>§shells: Vec<ShellRecord>§genus: i64§kind: BodyKindThe kind the body declares (Solid unless a producer says
otherwise). Skipped in JSON when Solid, so every body written
before the field existed reads and writes byte-identically; the flat
codec keeps its 1.0 header for a Solid for the same reason.
cells: Vec<CellRecord>Explicit regions, empty on all historical bodies. Empty storage is omitted so every existing JSON body keeps its bytes and digest.
Implementations§
Source§impl BrepSolid
impl BrepSolid
pub fn validate(&self) -> Vec<ValidationIssue>
Sourcepub fn vertex_match_band(&self) -> f64
pub fn vertex_match_band(&self) -> f64
The band within which validate takes an edge’s
curve end and its vertex for the same point (vendor export precision,
size-coupled for large parts). The watertight mesher reads the same
band, so a body that validates also tessellates.
Sourcepub fn validate_memoised(&self) -> Vec<ValidationIssue>
pub fn validate_memoised(&self) -> Vec<ValidationIssue>
validate with its CLEAN verdicts memoised by the
body’s content (lane R1 row 3, lane B’s B3). A rim built by the
closed-rim lane is validated by the surgery’s repaired-branch check, by
the group lane and by the pipeline’s exit acceptance; validate is a
pure function of the body, so a body whose serialised record read clean
once reads clean again. The key is two independent 64-bit hashes of the
serialisation, so ANY mutation (a moved control point, a re-trimmed
coedge, a renamed face) is validated afresh — the key is the content,
never an address. A body with issues is validated every time. The memo
is thread-local, bounded, and emptied by BrepSolid::clear_validate_memo at
each fillet operation’s entry (promoted 2026-10-18 on the 98 + 144
census); counted as
count.validate.memo_hit / count.validate.memo_miss.
pub fn validate_with_tolerances( &self, tolerances: &KernelTolerances, ) -> Vec<ValidationIssue>
pub fn validate_detailed( &self, tolerances: &KernelTolerances, ) -> ValidationReport
Sourcepub fn validate_scoped(
&self,
geometry_faces: &HashSet<u64, FxBuildHasher>,
) -> Vec<ValidationIssue>
pub fn validate_scoped( &self, geometry_faces: &HashSet<u64, FxBuildHasher>, ) -> Vec<ValidationIssue>
validate reading the per-coedge GEOMETRY (carrier,
pcurve against edge, uv wire) of the faces in geometry_faces only.
Every structural check — ids, loop closure, edge use counts, curve
endpoints against vertices, the Euler count — still reads the whole
solid. A boolean uses this for faces it carried through unchanged
from an operand (BooleanOptions::untouched_passthrough): their
geometry is the operand’s, byte for byte, and re-reading it is the
cost the record named.
Sourcepub fn validate_detailed_scoped(
&self,
tolerances: &KernelTolerances,
geometry_faces: Option<&HashSet<u64, FxBuildHasher>>,
) -> ValidationReport
pub fn validate_detailed_scoped( &self, tolerances: &KernelTolerances, geometry_faces: Option<&HashSet<u64, FxBuildHasher>>, ) -> ValidationReport
validate_detailed with the geometry checks
restricted as validate_scoped describes;
None reads every face.
Sourcepub fn bounding_hole_count(&self) -> i64
pub fn bounding_hole_count(&self) -> i64
H in the reduced-complex Euler count V - E + F - H: per face, the
loops that actually bound area, less its outer one.
A boundary collapsed to a single point — STEP’s VERTEX_LOOP, which
this kernel models as a single-use degenerate edge carrying a pcurve —
encloses no area, so it is not a hole. The reduced complex already
leaves that edge out of E and its vertex out of V; leaving its loop
out of H is the same rule applied to the same collapsed cell.
Counting it as a hole subtracts a spurious 1 per puncture. An ODD number of punctures then makes the characteristic odd, which no closed orientable surface has; an even number keeps it even and quietly inflates the derived genus by half of them.
Sourcepub fn coincident_parallel_edge_pairs(&self) -> usize
pub fn coincident_parallel_edge_pairs(&self) -> usize
Count disjoint pairs of non-degenerate edges that ride ONE geometric locus between the same endpoint vertices (OCC wall-split rims). Each such pair contributes a single locus to the cell complex, so Euler accounting credits it once.
A pair that is the WHOLE loop of a face is not one locus counted
twice: the face between the two edges is a cell of the complex (a lens
sliver), and the plain count already holds it. ABC 00000702’s torus
face 449 is bounded by two arcs 1.1e-5 apart (u 0.999999 and 1.0 in its
chart) with faces 545 and 473 meeting across it. The credit, read at
1e-6 x (1 + |p|) = 1.2e-3 so far from the origin, took the arcs for one
locus and turned the solid’s characteristic -8 (genus 5) into an
impossible -7, so two of the file’s 29 solids failed validation
(BREP_EULER_LENS_PAIR=0 credits such pairs as before).
Source§impl BrepSolid
impl BrepSolid
Sourcepub fn clear_validate_memo()
pub fn clear_validate_memo()
Empty the clean-verdict memo of BrepSolid::validate_memoised:
called at a fillet operation’s entry, so each operation pays for the
first read of every body it validates.
Sourcepub fn validate_memo_key(&self) -> Option<(u64, u64)>
pub fn validate_memo_key(&self) -> Option<(u64, u64)>
The body’s memo key: the 128-bit two-lane content hash
(mass_properties::TwoLane, bit-exact on every float) over EVERY
field the body serialises — ids, names, kind, genus, vertices, edges,
shells, faces, loops, coedges, cells — so any mutation is a new key.
(A JSON serialisation of the body read the same content at ~10× the
cost: float formatting.)