pub struct LevelSetBoolean;Expand description
Boolean operations on level-set fields via min/max composition.
All operations create a new LevelSetField with the same grid layout as
field_a. The fields must have identical grid dimensions, spacing, and origin.
Implementations§
Source§impl LevelSetBoolean
impl LevelSetBoolean
Sourcepub fn union(field_a: &LevelSetField, field_b: &LevelSetField) -> LevelSetField
pub fn union(field_a: &LevelSetField, field_b: &LevelSetField) -> LevelSetField
Union of two level-set fields: φ = min(φ_a, φ_b).
Corresponds to the union of the two implicit surfaces.
§Arguments
field_a– first operandfield_b– second operand (must have same grid asfield_a)
Sourcepub fn intersection(
field_a: &LevelSetField,
field_b: &LevelSetField,
) -> LevelSetField
pub fn intersection( field_a: &LevelSetField, field_b: &LevelSetField, ) -> LevelSetField
Intersection of two level-set fields: φ = max(φ_a, φ_b).
Corresponds to the intersection of the two implicit surfaces.
§Arguments
field_a– first operandfield_b– second operand (must have same grid asfield_a)
Sourcepub fn difference(
field_a: &LevelSetField,
field_b: &LevelSetField,
) -> LevelSetField
pub fn difference( field_a: &LevelSetField, field_b: &LevelSetField, ) -> LevelSetField
Difference A − B: φ = max(φ_a, −φ_b).
Corresponds to removing the region of field_b from field_a.
§Arguments
field_a– base operandfield_b– region to subtract
Sourcepub fn complement(field_a: &LevelSetField) -> LevelSetField
pub fn complement(field_a: &LevelSetField) -> LevelSetField
Complement (negation): φ = −φ_a.
Flips the inside/outside classification of the level-set.
§Arguments
field_a– the level-set field to negate
Sourcepub fn smooth_union(
field_a: &LevelSetField,
field_b: &LevelSetField,
k: f64,
) -> LevelSetField
pub fn smooth_union( field_a: &LevelSetField, field_b: &LevelSetField, k: f64, ) -> LevelSetField
Smooth minimum blend (C¹ union): φ = smin(φ_a, φ_b, k).
Produces a smooth blend at the union boundary with blend radius k.
§Arguments
field_a– first operandfield_b– second operandk– blend radius (larger k → smoother blend)
Auto Trait Implementations§
impl Freeze for LevelSetBoolean
impl RefUnwindSafe for LevelSetBoolean
impl Send for LevelSetBoolean
impl Sync for LevelSetBoolean
impl Unpin for LevelSetBoolean
impl UnsafeUnpin for LevelSetBoolean
impl UnwindSafe for LevelSetBoolean
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
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.