pub enum Field2D<B: Backend> {
Circle {
r: Tensor<B, 2, Float>,
device: B::Device,
},
Ellipse {
a: Tensor<B, 2, Float>,
b: Tensor<B, 2, Float>,
device: B::Device,
},
Line {
normal: Tensor<B, 2, Float>,
device: B::Device,
},
Cylinder {
r: Tensor<B, 2, Float>,
device: B::Device,
},
}
Expand description
Represents a 2D geometric shape that can be converted into a Isosurface
.
Variants§
Circle
A circle defined by its radius
Ellipse
An ellipse defined by its semi-major and semi-minor axes and center.
Line
Line in 2D space
Cylinder
A cylinder in 2D space (infinite circle)
Implementations§
Source§impl<B: Backend> Field2D<B>
impl<B: Backend> Field2D<B>
Sourcepub fn circle(r: f32, device: B::Device) -> Self
pub fn circle(r: f32, device: B::Device) -> Self
Allocate a circle ScalarField
in the given device’s memory.
Sourcepub fn ellipse(a: f32, b: f32, device: B::Device) -> Self
pub fn ellipse(a: f32, b: f32, device: B::Device) -> Self
Allocate an ellipse ScalarField
in the given device’s memory.
Sourcepub fn line(normal: NVector<2>, device: B::Device) -> Self
pub fn line(normal: NVector<2>, device: B::Device) -> Self
Allocate a line ScalarField
in the given device’s memory.
Sourcepub fn cylinder(r: f32, device: B::Device) -> Self
pub fn cylinder(r: f32, device: B::Device) -> Self
Allocate a cylinder ScalarField
in the given device’s memory.
This is equivalent to a hypercylinder in 2D space.
Trait Implementations§
Source§impl<B: Backend> IntoIsosurface<2, B> for Field2D<B>
impl<B: Backend> IntoIsosurface<2, B> for Field2D<B>
Source§fn into_isosurface(self, constant: f32) -> Isosurface<2, B>
fn into_isosurface(self, constant: f32) -> Isosurface<2, B>
Converts the object into a
Isosurface<N, B>
.Auto Trait Implementations§
impl<B> Freeze for Field2D<B>where
<B as Backend>::Device: Freeze,
<B as Backend>::FloatTensorPrimitive: Freeze,
<B as Backend>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for Field2D<B>where
<B as Backend>::Device: RefUnwindSafe,
<B as Backend>::FloatTensorPrimitive: RefUnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for Field2D<B>
impl<B> Sync for Field2D<B>
impl<B> Unpin for Field2D<B>where
<B as Backend>::Device: Unpin,
<B as Backend>::FloatTensorPrimitive: Unpin,
<B as Backend>::QuantizedTensorPrimitive: Unpin,
impl<B> UnwindSafe for Field2D<B>where
<B as Backend>::Device: UnwindSafe,
<B as Backend>::FloatTensorPrimitive: UnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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