pub struct Algebra<B: Backend> { /* private fields */ }
Expand description
Standard implementation of CSG operations using min/max R-functions.
Zero-cost implementation that provides exact Boolean operations on scalar fields. Thread-safe and stateless.
§Examples
use crater::csg::prelude::*;
use burn::backend::wgpu::Wgpu;
let algebra = Algebra::<Wgpu>::default();
// let combined = algebra.union(sphere_field, cube_field);
Trait Implementations§
Source§impl<B: Backend> CSGAlgebra<B> for Algebra<B>
impl<B: Backend> CSGAlgebra<B> for Algebra<B>
Source§fn union(
&self,
f1: Tensor<B, 1, Float>,
f2: Tensor<B, 1, Float>,
) -> Tensor<B, 1, Float>
fn union( &self, f1: Tensor<B, 1, Float>, f2: Tensor<B, 1, Float>, ) -> Tensor<B, 1, Float>
Computes the union of two scalar fields using
min(f₁, f₂)
. Read moreAuto Trait Implementations§
impl<B> Freeze for Algebra<B>
impl<B> RefUnwindSafe for Algebra<B>where
B: RefUnwindSafe,
impl<B> Send for Algebra<B>
impl<B> Sync for Algebra<B>
impl<B> Unpin for Algebra<B>where
B: Unpin,
impl<B> UnwindSafe for Algebra<B>where
B: UnwindSafe,
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<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>
Converts
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>
Converts
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