implicit

Trait Implicit

Source
pub trait Implicit {
Show 23 methods // Required methods fn sample(&self, pos: Point) -> f32; fn bounding_box(&self) -> Option<Rect>; fn follows_rules(&self) -> bool; // Provided methods fn boxed(self) -> SyncBox where Self: Sized + 'static + Sync { ... } fn and<B: Implicit>(self, other: B) -> And<Self, B> where Self: Sized { ... } fn and_not<B: Implicit>(self, other: B) -> And<Self, Not<B>> where Self: Sized { ... } fn or<B: Implicit>(self, other: B) -> Or<Self, B> where Self: Sized { ... } fn xor<B: Implicit>(self, other: B) -> Xor<Self, B> where Self: Sized { ... } fn shrink(self, by: f32) -> Boundary<Self> where Self: Sized { ... } fn grow(self, by: f32) -> Boundary<Self> where Self: Sized { ... } fn cache_bounding_box(self) -> BoxCache<Self> where Self: Sized { ... } fn transform(self) -> Transformation<Self> where Self: Sized { ... } fn scale(self, sx: f32, sy: f32) -> Transformation<Self> where Self: Sized { ... } fn translate(self, x: f32, y: f32) -> Transformation<Self> where Self: Sized { ... } fn rotate(self, rads: f32) -> Transformation<Self> where Self: Sized { ... } fn not(self) -> Not<Self> where Self: Sized { ... } fn outline_inner(self, distance: f32) -> And<Self, Not<Boundary<Self>>> where Self: Sized + Clone { ... } fn outline_outer(self, distance: f32) -> And<Boundary<Self>, Not<Self>> where Self: Sized + Clone { ... } fn borrow<'a>(&'a self) -> &'a dyn Implicit where Self: Sized { ... } fn fix_rules(self, resolution: f32) -> PolyGroup where Self: Sized + Sync { ... } fn smooth(self, amount: f32, resolution: f32) -> Boundary<PolyGroup> where Self: Sized + Sync { ... } fn center(&self) -> Option<Point> { ... } fn center_at(self, point: &Point) -> Transformation<Self> where Self: Sized { ... }
}

Required Methods§

Source

fn sample(&self, pos: Point) -> f32

Returns the distance from a point to the nearest edge of a surface.

If the point is outside of the surface, return a positive number. If the point is inside of the surface, return a negative number. If the point is on the line, return 0.

Source

fn bounding_box(&self) -> Option<Rect>

Returns a bounding box that surrounds a shape (if one exists).

If the shape is infinite, return None.

Source

fn follows_rules(&self) -> bool

True if the shape follows all the rules about implicit shapes.

Provided Methods§

Source

fn boxed(self) -> SyncBox
where Self: Sized + 'static + Sync,

Source

fn and<B: Implicit>(self, other: B) -> And<Self, B>
where Self: Sized,

Source

fn and_not<B: Implicit>(self, other: B) -> And<Self, Not<B>>
where Self: Sized,

Source

fn or<B: Implicit>(self, other: B) -> Or<Self, B>
where Self: Sized,

Source

fn xor<B: Implicit>(self, other: B) -> Xor<Self, B>
where Self: Sized,

Source

fn shrink(self, by: f32) -> Boundary<Self>
where Self: Sized,

Source

fn grow(self, by: f32) -> Boundary<Self>
where Self: Sized,

Source

fn cache_bounding_box(self) -> BoxCache<Self>
where Self: Sized,

Source

fn transform(self) -> Transformation<Self>
where Self: Sized,

Source

fn scale(self, sx: f32, sy: f32) -> Transformation<Self>
where Self: Sized,

Source

fn translate(self, x: f32, y: f32) -> Transformation<Self>
where Self: Sized,

Source

fn rotate(self, rads: f32) -> Transformation<Self>
where Self: Sized,

Source

fn not(self) -> Not<Self>
where Self: Sized,

Source

fn outline_inner(self, distance: f32) -> And<Self, Not<Boundary<Self>>>
where Self: Sized + Clone,

Source

fn outline_outer(self, distance: f32) -> And<Boundary<Self>, Not<Self>>
where Self: Sized + Clone,

Source

fn borrow<'a>(&'a self) -> &'a dyn Implicit
where Self: Sized,

Source

fn fix_rules(self, resolution: f32) -> PolyGroup
where Self: Sized + Sync,

Source

fn smooth(self, amount: f32, resolution: f32) -> Boundary<PolyGroup>
where Self: Sized + Sync,

Source

fn center(&self) -> Option<Point>

Source

fn center_at(self, point: &Point) -> Transformation<Self>
where Self: Sized,

Trait Implementations§

Source§

impl<'a> Implicit for &'a dyn Implicit

Source§

fn sample(&self, pos: Point) -> f32

Returns the distance from a point to the nearest edge of a surface. Read more
Source§

fn bounding_box(&self) -> Option<Rect>

Returns a bounding box that surrounds a shape (if one exists). Read more
Source§

fn follows_rules(&self) -> bool

True if the shape follows all the rules about implicit shapes.
Source§

fn and<B: Implicit>(self, other: B) -> And<Self, B>
where Self: Sized,

Source§

fn and_not<B: Implicit>(self, other: B) -> And<Self, Not<B>>
where Self: Sized,

Source§

fn or<B: Implicit>(self, other: B) -> Or<Self, B>
where Self: Sized,

Source§

fn xor<B: Implicit>(self, other: B) -> Xor<Self, B>
where Self: Sized,

Source§

fn shrink(self, by: f32) -> Boundary<Self>
where Self: Sized,

Source§

fn grow(self, by: f32) -> Boundary<Self>
where Self: Sized,

Source§

fn cache_bounding_box(self) -> BoxCache<Self>
where Self: Sized,

Source§

fn transform(self) -> Transformation<Self>
where Self: Sized,

Source§

fn scale(self, sx: f32, sy: f32) -> Transformation<Self>
where Self: Sized,

Source§

fn translate(self, x: f32, y: f32) -> Transformation<Self>
where Self: Sized,

Source§

fn rotate(self, rads: f32) -> Transformation<Self>
where Self: Sized,

Source§

fn not(self) -> Not<Self>
where Self: Sized,

Source§

fn outline_inner(self, distance: f32) -> And<Self, Not<Boundary<Self>>>
where Self: Sized + Clone,

Source§

fn outline_outer(self, distance: f32) -> And<Boundary<Self>, Not<Self>>
where Self: Sized + Clone,

Source§

fn borrow<'a>(&'a self) -> &'a dyn Implicit
where Self: Sized,

Source§

fn center(&self) -> Option<Point>

Source§

fn center_at(self, point: &Point) -> Transformation<Self>
where Self: Sized,

Implementations on Foreign Types§

Source§

impl<'a, A> Implicit for &'a A
where A: Implicit + Sized,

Implementors§