Skip to main content

BooleanReport

Struct BooleanReport 

Source
pub struct BooleanReport { /* private fields */ }
Expand description

What a boolean read within tolerance, as ReferenceExactCompiler::compile_exact_with_report reports it (#236). The within-tolerance decisions one boolean took (#236).

Empty means no such decision fired: the result is the exact boolean of the operands as given, its new vertices and curves evaluated in f64 (see the crate docs). Otherwise it is the exact boolean of operands moved by at most Self::linear and turned by at most Self::angular, both within the caller’s tolerance.

Either way, constructed points closer than ROUNDING_FACTOR times Self::extent were read as one point without a decision, and are not reported (#244); Self::rounding_floor covers that residue and the move of an unrecorded angular one.

A boolean the caller’s tolerance left refused is cut again at FINER_FACTOR times it (#332); its readings then lie within that finer tolerance, and Self::finer says so.

Implementations§

Source§

impl BooleanReport

Source

pub fn decisions(&self) -> &[ToleranceDecision]

One entry per kind of reading that fired, in ToleranceDecisionKind order, each with its worst magnitude.

Source

pub fn is_exact(&self) -> bool

Whether no within-tolerance decision fired: the result is the exact boolean of the operands as given.

Source

pub fn linear(&self) -> f64

The largest distance any reading moved a feature (zero when exact).

Source

pub fn angular(&self) -> f64

The largest angle any reading turned a direction (zero when exact).

Source

pub fn contains(&self, kind: ToleranceDecisionKind) -> bool

Whether a reading of kind fired.

Source

pub fn rounding_floor(&self) -> f64

The absolute rounding floor that applied to this result (#244), in the operands’ length unit: ROUNDING_FACTOR times Self::extent, plus what an angular residue of that factor (radians, read without a decision) moves a point of the operands by, at most 2 sqrt(3) times Self::extent (a turn about any point of the operands’ box).

A residue between constructed points (cuts, vertices, a point on an edge) up to ROUNDING_FACTOR times Self::extent was read as one exact point evaluated twice, without the tolerance, and is in no ToleranceDecision; only a larger one is a decision within tolerance. This floor is the widening that covers those unrecorded linear and angular residues, not the threshold between them and a decision: a residue below it may still be a reported decision. So a consumer widening distances on the result widens them by this floor too, even when Self::is_exact holds. Zero when no general boolean produced the report (the default report).

Source

pub fn extent(&self) -> f64

The extent Self::rounding_floor was scaled from (#244): the largest coordinate magnitude of the operands as given to the boolean, the larger of the two operands’ readings, each the largest of

  • max(|x|, |y|, |z|) over every topology vertex, and
  • per plane, cylinder, elliptical cylinder, cone, sphere or torus surface, max(|x|, |y|, |z|) of its frame origin plus its size: zero for a plane, |radius| for a cylinder, a cone (its radius at the frame origin) or a sphere, the larger semi-axis for an elliptical cylinder, |major + minor| for a torus; other surface families add nothing beyond their vertices.

Coordinates are read about the operands’ own origin, so the extent grows with their distance from it. An operand whose reading is not finite counts as zero. After Self::merged, the largest extent of the merged reports.

Source

pub fn merged(self, other: &BooleanReport) -> BooleanReport

This report and other together: what a chain of booleans read (each kind once, with the worst magnitude of either).

The merged rounding floor is the larger of the two (Self::extent is the larger extent), sound for every boolean of the chain: each one’s floor is at most it. A rigid placement of a result leaves distances between its points unchanged, so a report carried through one keeps its floor as is (#244).

The merged report is Self::finer when either is.

Source

pub fn finer(&self) -> bool

Whether the boolean was cut at FINER_FACTOR times the caller’s tolerance, its readings at the caller’s own having left it refused (#332): features of the operands closer than the caller’s tolerance but further apart than the finer one were then decided by the exact predicates, and every reading in Self::decisions lies within the finer tolerance. After Self::merged, whether any boolean of the chain was.

Trait Implementations§

Source§

impl Clone for BooleanReport

Source§

fn clone(&self) -> BooleanReport

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 BooleanReport

Source§

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

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

impl Default for BooleanReport

Source§

fn default() -> BooleanReport

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

impl PartialEq for BooleanReport

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BooleanReport

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.