pub struct MeshBoolean;Expand description
Performs boolean operations between two closed triangle meshes.
The implementation uses an approximate approach:
- For each triangle in each mesh, test its centroid against the opposite mesh using ray casting (inside-outside test).
- Select triangles based on the boolean operation type.
- Concatenate selected triangles into the output mesh.
Note: This is a conservative approximation. It works well for non-intersecting
or barely-intersecting meshes. For fully general CSG with proper surface
intersection curves, use csg instead.
Implementations§
Source§impl MeshBoolean
impl MeshBoolean
Sourcepub fn execute(
op: BooleanOp,
mesh_a: &TriangleMesh,
mesh_b: &TriangleMesh,
) -> Result<TriangleMesh>
pub fn execute( op: BooleanOp, mesh_a: &TriangleMesh, mesh_b: &TriangleMesh, ) -> Result<TriangleMesh>
Execute a boolean operation between two meshes.
§Arguments
op– the type of operation.mesh_a– the first operand.mesh_b– the second operand.
§Returns
A new TriangleMesh representing the result, or an Error if the
inputs are invalid (e.g., empty meshes).
Auto Trait Implementations§
impl Freeze for MeshBoolean
impl RefUnwindSafe for MeshBoolean
impl Send for MeshBoolean
impl Sync for MeshBoolean
impl Unpin for MeshBoolean
impl UnsafeUnpin for MeshBoolean
impl UnwindSafe for MeshBoolean
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.