Skip to main content

BrepSolid

Struct BrepSolid 

Source
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: MassPropertiesCache

Content-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: BodyKind

The 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

Source

pub fn validate(&self) -> Vec<ValidationIssue>

Source

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.

Source

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.

Source

pub fn validate_with_tolerances( &self, tolerances: &KernelTolerances, ) -> Vec<ValidationIssue>

Source

pub fn validate_detailed( &self, tolerances: &KernelTolerances, ) -> ValidationReport

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.)

Trait Implementations§

Source§

impl Clone for BrepSolid

Source§

fn clone(&self) -> BrepSolid

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BrepSolid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BrepSolid

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<BrepSolid, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for BrepSolid

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SolidScale for BrepSolid

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more