Struct BooleanEvidence

Source
#[non_exhaustive]
pub struct BooleanEvidence { pub subject_triangles: usize, pub tool_triangles: usize, pub output_triangles: usize, pub output_components: usize, pub disjoint_tools: usize, pub sub_operations: usize, pub attribute_fates: Vec<(String, AttributeFate)>, pub coincident_faces_encountered: bool, pub analytic_path: bool, pub relative_overlap: Option<f64>, }
Expand description

Counters describing one boolean evaluation.

Every field is a fact about the computation, never a quality verdict. A caller decides whether a given count is acceptable for its domain.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§subject_triangles: usize

Triangles in the subject operand as supplied.

§tool_triangles: usize

Triangles across all tool operands as supplied.

§output_triangles: usize

Triangles in the result.

§output_components: usize

Connected components in the result.

A difference that splits a wall into two pieces reports 2. Callers that expect a single solid can detect the split instead of discovering it downstream in a quantity takeoff.

§disjoint_tools: usize

Tool operands that did not intersect the subject at all.

A no-op cut is usually a placement bug upstream, but it is not an error here, so it is reported rather than rejected.

§sub_operations: usize

Sub-operations executed, for composed operands.

SymmetricDifference composed from union, intersection, and difference reports 3; a native implementation reports 1. This is how a caller tells a composed path from a primitive one.

§attribute_fates: Vec<(String, AttributeFate)>

What happened to each named attribute channel on the subject.

A boolean creates vertices along the cut that have no preimage in either operand, so a channel cannot always survive. Reporting the fate per channel is what turns a silent loss into an answer: the caller learns the data is gone AND why, instead of comparing the mesh before and after to find out.

§coincident_faces_encountered: bool

Whether the provider detected coincident faces between operands.

Coincident faces are the dominant source of cross-kernel disagreement. Reporting the encounter lets a caller treat those results with more care without Axiolid choosing a policy on its behalf.

§analytic_path: bool

Whether an analytic closed-form path produced this result instead of the general boolean solver.

An analytic path is exact only for the operand shapes it recognises, and it produces a different (though equally valid) triangulation from the general solver. A caller comparing results across runs, or reproducing a result elsewhere, needs to know which machinery ran – the same reason Self::sub_operations distinguishes a composed result from a primitive one.

§relative_overlap: Option<f64>

Relative overlap between operands, when the provider measured it.

The smallest operand-overlap extent divided by the operand size, so it is scale-free: two cubes overlapping by 1mm at metre scale and by 1um at millimetre scale report the same number. None means the provider did not measure conditioning, never that the input was well conditioned.

Construction is f64 (ADR 0045), so accuracy degrades as this approaches zero: invisible above 1e-6, smooth between 1e-6 and 1e-12, severe below 1e-12. This is a fact about the computation, not a verdict – a caller decides what its domain tolerates.

Implementations§

Source§

impl BooleanEvidence

Source

pub fn record( subject_triangles: usize, tool_triangles: usize, output_triangles: usize, output_components: usize, ) -> Self

Record one completed operation.

A constructor rather than struct-literal syntax because the type is #[non_exhaustive]: out-of-tree providers must be able to build evidence without breaking when a counter is added.

Source

pub fn with_attribute_fates(self, fates: Vec<(String, AttributeFate)>) -> Self

Record what happened to the subject’s attribute channels.

A provider that carries no attributes still calls this, reporting every channel as dropped: an empty list would be indistinguishable from a subject that had no channels to begin with.

Source

pub const fn with_relative_overlap(self, overlap: f64) -> Self

Record the measured relative overlap between operands.

Only a provider that actually measured conditioning may call this; leaving the field None is the honest default for one that did not.

Source

pub const fn with_analytic_path(self, analytic: bool) -> Self

Record that an analytic closed-form path produced this result.

Source

pub const fn with_disjoint_tools(self, count: usize) -> Self

Set the count of tools that did not meet the subject.

Source

pub const fn with_sub_operations(self, count: usize) -> Self

Set how many sub-operations produced this result.

Source

pub const fn with_coincident_faces(self, encountered: bool) -> Self

Record that coincident faces were encountered between operands.

Source

pub fn absorb(&mut self, other: Self)

Merge evidence from a sub-operation into a running total.

Input counts come from the outermost call, so they are kept rather than summed; output counts and flags come from the final sub-operation.

Trait Implementations§

Source§

impl Clone for BooleanEvidence

Source§

fn clone(&self) -> BooleanEvidence

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BooleanEvidence

Source§

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

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

impl Default for BooleanEvidence

Source§

fn default() -> BooleanEvidence

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BooleanEvidence

Source§

fn eq(&self, other: &BooleanEvidence) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BooleanEvidence

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.