pub struct CsgLeaves {
pub leaves: Vec<GeomLeaf>,
pub expr: CsgExpr,
pub paths: Vec<LeafPath>,
}Expand description
Flattened analytic model of one tree: primitive leaves + boolean structure.
Fields§
§leaves: Vec<GeomLeaf>§expr: CsgExpr§paths: Vec<LeafPath>Branch-path of each leaf (parallel to leaves), relative to the walk
root passed to CsgLeaves::from_dynamic.
Implementations§
Source§impl CsgLeaves
impl CsgLeaves
Sourcepub fn from_dynamic(
obj: &DynamicObject,
world: DAffine3,
aabb_hint: Option<AabbHint<'_>>,
) -> Self
pub fn from_dynamic( obj: &DynamicObject, world: DAffine3, aabb_hint: Option<AabbHint<'_>>, ) -> Self
Flatten obj into leaves + boolean structure. world is the
transform above the walk root; aabb_hint supplies proxy bounds for
unsupported subtrees (see AabbHint).
Sourcepub fn from_dynamic_unfeatured(
obj: &DynamicObject,
world: DAffine3,
aabb_hint: Option<AabbHint<'_>>,
) -> Self
pub fn from_dynamic_unfeatured( obj: &DynamicObject, world: DAffine3, aabb_hint: Option<AabbHint<'_>>, ) -> Self
Like Self::from_dynamic, but edge-feature masks are omitted: the
solid is the tree as if no chamfer/fillet were applied, with leaf
paths keeping the same shape (a feature’s child region stays [0]).
Feature lowering resolves its edges against this view so a sibling
feature’s cut cannot trim a stored edge short — masks then span the
full edge and overlap at shared corners instead of leaving a sliver
of the original sharp edge standing (mixed chamfer/fillet corners).
Sourcepub fn spans(&self, ro: DVec3, rd: DVec3) -> Vec<HitSpan>
pub fn spans(&self, ro: DVec3, rd: DVec3) -> Vec<HitSpan>
All solid stretches of the ray through the final solid, sorted by t.
rd need not be normalized — t stays in ro + t·rd units.
Sourcepub fn first_hit(&self, ro: DVec3, rd: DVec3, t_min: f64) -> Option<HitBoundary>
pub fn first_hit(&self, ro: DVec3, rd: DVec3, t_min: f64) -> Option<HitBoundary>
First surface crossing with t > t_min (typically 0.0).
Sourcepub fn contains(&self, p: DVec3) -> bool
pub fn contains(&self, p: DVec3) -> bool
Whether the final solid contains p (closed: boundary counts as inside).
Sourcepub fn boundary_normal(
&self,
boundary: &HitBoundary,
ro: DVec3,
rd: DVec3,
) -> DVec3
pub fn boundary_normal( &self, boundary: &HitBoundary, ro: DVec3, rd: DVec3, ) -> DVec3
Outward normal of the final solid at a boundary returned by
Self::spans/Self::first_hit (unit length, world space).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsgLeaves
impl RefUnwindSafe for CsgLeaves
impl Send for CsgLeaves
impl Sync for CsgLeaves
impl Unpin for CsgLeaves
impl UnsafeUnpin for CsgLeaves
impl UnwindSafe for CsgLeaves
Blanket Implementations§
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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