pub enum CsgNode {
Leaf(CsgLeafNode),
Op {
op: OpType,
children: Vec<CsgNode>,
transform: Mat3x4,
},
}Variants§
Implementations§
Source§impl CsgNode
impl CsgNode
pub fn leaf(mesh: ManifoldImpl) -> Self
pub fn leaf_node(node: CsgLeafNode) -> Self
pub fn op(op: OpType, left: CsgNode, right: CsgNode) -> Self
pub fn op_n(op: OpType, children: Vec<CsgNode>) -> Self
Sourcepub fn evaluate(&self) -> ManifoldImpl
pub fn evaluate(&self) -> ManifoldImpl
Evaluate the CSG tree to produce a single mesh. Uses explicit-stack DFS to avoid recursion stack overflow. Port of C++ CsgOpNode::ToLeafNode()
Sourcepub fn evaluate_with_token(&self, token: Option<&CancelToken>) -> ManifoldImpl
pub fn evaluate_with_token(&self, token: Option<&CancelToken>) -> ManifoldImpl
CsgNode::evaluate with cooperative cancellation.
A cancelled evaluation yields an empty mesh whose status is
Error::Cancelled. Mirrors C++ CsgOpNode::ToLeafNode(ctx)
(csg_tree.cpp:644-800), which checks the flag once per stack step and
substitutes an ErrorLeaf(Cancelled) for the pending work.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsgNode
impl RefUnwindSafe for CsgNode
impl Send for CsgNode
impl Sync for CsgNode
impl Unpin for CsgNode
impl UnsafeUnpin for CsgNode
impl UnwindSafe for CsgNode
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