ClippingProcessor

Struct ClippingProcessor 

Source
pub struct ClippingProcessor {
    pub epsilon: f64,
    /* private fields */
}
Expand description

CSG Clipping Processor

Fields§

§epsilon: f64

Floor for Self::clip_mesh’s projected classification epsilon (and the whole tolerance Self::clip_triangle still uses). Raw f64, never rescaled by unit_scale, so its unit is the caller’s: file units on the processors/boolean path, METRES on router/layers. See [plane_eps] for the frames, the sizing and the KNOWN LIMITATION.

Implementations§

Source§

impl ClippingProcessor

Source

pub fn subtract_mesh_many( &self, host_mesh: &Mesh, cutters: &[&Mesh], ) -> GroupCut

Subtract a GROUP of pairwise-disjoint opening cutters from the host in ONE conforming arrangement per chunk (disjoint-cutter batching).

On any chunk’s rejection the WHOLE group is rejected and the host is left un-cut: the router’s per-opening sequential loop (own budget, #635 fallback machinery, own diagnostics) then takes over for the members. Rejection is the expected, handled outcome, so only an invalid kernel output or an accept-gate refusal records a failure; anything more would be noise on elements whose voids end up perfectly cut (the issue-582/583 zero-CSG-failure bar).

Source§

impl ClippingProcessor

Source

pub fn union_mesh(&self, mesh_a: &Mesh, mesh_b: &Mesh) -> Result<Mesh>

Union two meshes together using CSG boolean operations on the pure-Rust exact kernel.

Empty operands are handled silently — they have a unique correct answer. “Silently” includes the #3440 audit, and so does the kernel-failure merge: both come back as [UnionOutcome::PassThrough], which this does not audit. Auditing a mesh no boolean produced blames this union for topology it did not create, and under csg_manifold_gate that lands a spurious NonManifoldRejected in both the public failure list and the census the flip decision is read off — on top of the KernelOutputInvalid the same incident already recorded.

Source

pub fn union_meshes(&self, meshes: &[Mesh]) -> Result<Mesh>

Union multiple meshes together

Convenience method that sequentially unions all non-empty meshes. Skips empty meshes to avoid unnecessary CSG operations. The #3440 audit runs ONCE, on the mesh handed back — driving union_mesh here would record a tear per intermediate the caller never sees.

Source§

impl ClippingProcessor

Source

pub fn new() -> Self

Create a new clipping processor

Source

pub fn take_failures(&self) -> Vec<BoolFailure>

Drain and return the failures recorded by this processor since its creation (or the last take_failures call). The processor’s internal log is cleared.

Source

pub fn failure_count(&self) -> usize

Number of failures currently buffered (without draining).

Source

pub fn clip_triangle(&self, triangle: &Triangle, plane: &Plane) -> ClipResult

Clip a triangle against a plane Returns triangles that are in front of the plane

Source

pub fn subtract_mesh(&self, host_mesh: &Mesh, opening_mesh: &Mesh) -> GroupCut

Subtract opening mesh from host mesh using CSG boolean operations on the pure-Rust exact mesh-arrangement kernel.

Returns the same GroupCut as Self::subtract_mesh_many, a group of one. It used to return the host un-cut on every bail, the shape of a real cut, and callers guessed which one happened from the triangle count and a 0.1 % volume test that read a small real cut as no cut (#4692). A rejection leaves the host untouched. A cutter the kernel classifies as not reaching the host solid still produces the consolidated arrangement output, as it always did; it comes back as GroupCut::Retessellated, not as a cut, unless the arrangement did not conform and the output has the host’s triangle count, which comes back as Rejected(Nonconforming) (#5362).

Unlike the group path, the single cutter records a BoolFailure (drainable via Self::take_failures) for an empty cutter (EmptyOperand), a missed bounds overlap (NoBoundsOverlap) and a budget trip (OperandTooLarge), as well as for InvalidOutput and GateRejected. EmptyHost records nothing. Cut and Retessellated pass the same validation and gates. The accept path also runs record_topology_tear (#3440 step 1): diagnostic only, never gates, in every build. topology_gate_reject (#3440 step 2) runs the same closure predicate but, ONLY when the crate is built with the csg_topology_gate feature (off by default; no downstream crate turns it on), rejects a torn result the same way KernelOutputInvalid does.

Source

pub fn intersection_mesh(&self, mesh_a: &Mesh, mesh_b: &Mesh) -> Result<Mesh>

Intersect two meshes using CSG boolean operations on the pure-Rust exact kernel.

Returns the intersection of two meshes (the volume where both overlap).

Source

pub fn clip_mesh(&self, mesh: &Mesh, plane: &Plane) -> Result<Mesh>

Clip an entire mesh against a plane.

The classification epsilon is per-axis f32 rounding noise projected onto plane’s own normal and floored at Self::epsilon; see [plane_eps] for why it must scale with coordinate magnitude, why the magnitude is tracked per axis rather than maxed over all three, and why near_band_from_extent is deliberately not reused.

Trait Implementations§

Source§

impl Default for ClippingProcessor

Source§

fn default() -> Self

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

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
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more