pub struct ClippingProcessor {
pub epsilon: f64,
/* private fields */
}Expand description
CSG Clipping Processor
Fields§
§epsilon: f64Floor 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
impl ClippingProcessor
Sourcepub fn subtract_mesh_many(
&self,
host_mesh: &Mesh,
cutters: &[&Mesh],
) -> GroupCut
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
impl ClippingProcessor
Sourcepub fn union_mesh(&self, mesh_a: &Mesh, mesh_b: &Mesh) -> Result<Mesh>
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.
Sourcepub fn union_meshes(&self, meshes: &[Mesh]) -> Result<Mesh>
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
impl ClippingProcessor
Sourcepub fn take_failures(&self) -> Vec<BoolFailure>
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.
Sourcepub fn failure_count(&self) -> usize
pub fn failure_count(&self) -> usize
Number of failures currently buffered (without draining).
Sourcepub fn clip_triangle(&self, triangle: &Triangle, plane: &Plane) -> ClipResult
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
Sourcepub fn subtract_mesh(&self, host_mesh: &Mesh, opening_mesh: &Mesh) -> GroupCut
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.
Sourcepub fn intersection_mesh(&self, mesh_a: &Mesh, mesh_b: &Mesh) -> Result<Mesh>
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).
Sourcepub fn clip_mesh(&self, mesh: &Mesh, plane: &Plane) -> Result<Mesh>
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§
Auto Trait Implementations§
impl !Freeze for ClippingProcessor
impl !RefUnwindSafe for ClippingProcessor
impl Send for ClippingProcessor
impl !Sync for ClippingProcessor
impl Unpin for ClippingProcessor
impl UnwindSafe for ClippingProcessor
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
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 moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.