pub struct ADF<Float> {
pub tree: Quadtree<Vec<Arc<dyn Fn(P2<Float>) -> Float>>, Float>,
/* private fields */
}Fields§
§tree: Quadtree<Vec<Arc<dyn Fn(P2<Float>) -> Float>>, Float>Implementations§
Source§impl<_Float: Float + Signed + Sync> ADF<_Float>
impl<_Float: Float + Signed + Sync> ADF<_Float>
Sourcepub fn new(max_depth: u8, init: Vec<Arc<dyn Fn(P2<_Float>) -> _Float>>) -> Self
pub fn new(max_depth: u8, init: Vec<Arc<dyn Fn(P2<_Float>) -> _Float>>) -> Self
Create a new ADF instance. max_depth specifies maximum number of quadtree subdivisions;
init specifies initial sdf primitives.
Sourcepub fn with_gd_lattice_density(self, density: u32) -> Self
pub fn with_gd_lattice_density(self, density: u32) -> Self
Controls precision of primitive pruning in a bucket.
Sourcepub fn with_ipm_line_config(self, line_config: LineSearch<_Float>) -> Self
pub fn with_ipm_line_config(self, line_config: LineSearch<_Float>) -> Self
Underlying GD settings for the interior point method (a part of primitive pruning).
Sourcepub fn insert_sdf_domain(
&mut self,
domain: Rect<_Float, WorldSpace>,
f: Arc<dyn Fn(P2<_Float>) -> _Float + Send + Sync>,
) -> bool
pub fn insert_sdf_domain( &mut self, domain: Rect<_Float, WorldSpace>, f: Arc<dyn Fn(P2<_Float>) -> _Float + Send + Sync>, ) -> bool
Add a new sdf primitive function.
Source§impl<_Float: Float + Signed + AsPrimitive<f64>> ADF<_Float>
impl<_Float: Float + Signed + AsPrimitive<f64>> ADF<_Float>
pub fn display_sdf(&self, image: &mut RgbaImage, brightness: f64) -> &Self
Available on crate feature
drawing only.pub fn draw_bucket_weights(&self, image: &mut RgbaImage) -> &Self
Available on crate feature
drawing only.Trait Implementations§
Source§impl<_Float: Float> BoundingBox<_Float> for ADF<_Float>
impl<_Float: Float> BoundingBox<_Float> for ADF<_Float>
fn bounding_box(&self) -> Box2D<_Float, WorldSpace>
impl<Float> Send for ADF<Float>
impl<Float> Sync for ADF<Float>
Auto Trait Implementations§
impl<Float> Freeze for ADF<Float>where
Float: Freeze,
impl<Float> !RefUnwindSafe for ADF<Float>
impl<Float> Unpin for ADF<Float>where
Float: Unpin,
impl<Float> !UnwindSafe for ADF<Float>
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> Pointable for T
impl<T> Pointable for T
Source§impl<T, Sh> Shape<T> for Shwhere
Sh: SDF<T> + BoundingBox<T>,
impl<T, Sh> Shape<T> for Shwhere
Sh: SDF<T> + BoundingBox<T>,
fn translate(self, offset: V2<T, WorldSpace>) -> Translation<Self, T>where
Self: Sized,
Source§fn rotate(self, angle: Angle<T>) -> Rotation<Self, T>where
Self: Sized,
fn rotate(self, angle: Angle<T>) -> Rotation<Self, T>where
Self: Sized,
Rotate around the center of shape’s bounding box
Source§fn scale(self, scale: T) -> Scale<Self, T>where
Self: Sized,
fn scale(self, scale: T) -> Scale<Self, T>where
Self: Sized,
Scale around the center of shape’s bounding box
Source§fn subtraction<U>(self, other: U) -> Subtraction<Self, U>where
Self: Sized,
fn subtraction<U>(self, other: U) -> Subtraction<Self, U>where
Self: Sized,
Subtracion of two SDFs. Note that this operation is not commutative,
i.e.
Subtraction {a, b} =/= Subtraction {b, a}.Source§fn intersection<U>(self, other: U) -> Intersection<Self, U>where
Self: Sized,
fn intersection<U>(self, other: U) -> Intersection<Self, U>where
Self: Sized,
Intersection of two SDFs.