#[repr(C)]pub struct Sketch { /* private fields */ }
Expand description
A sketch
Sketches are currently limited to a single cycle of straight lines, represented by a number of points. For example, if the points a, b, and c are provided, the edges ab, bc, and ca are assumed.
Nothing about these edges is checked right now, but algorithms might assume
that the edges are non-overlapping. If you create a Sketch
with
overlapping edges, you’re on your own.
Examples
Convenient syntax for this operation is available through crate::syntax
.
use fj::syntax::*;
// `a` and `b` can be anything that converts to `fj::Shape`
let sketch = [[0., 0.], [1., 0.], [0., 1.]].sketch();
Implementations
sourceimpl Sketch
impl Sketch
sourcepub fn from_points(points: Vec<[f64; 2]>) -> Self
pub fn from_points(points: Vec<[f64; 2]>) -> Self
Create a sketch from a bunch of points
sourcepub fn from_circle(circle: Circle) -> Self
pub fn from_circle(circle: Circle) -> Self
Create a sketch from a circle
sourcepub fn with_color(self, color: [u8; 4]) -> Self
pub fn with_color(self, color: [u8; 4]) -> Self
Set the rendering color of the sketch in RGBA
Trait Implementations
impl StructuralPartialEq for Sketch
Auto Trait Implementations
impl RefUnwindSafe for Sketch
impl Send for Sketch
impl !Sync for Sketch
impl Unpin for Sketch
impl UnwindSafe for Sketch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Difference for Twhere
T: Clone + Into<Shape2d>,
impl<T> Difference for Twhere
T: Clone + Into<Shape2d>,
sourcefn difference<Other>(&self, other: &Other) -> Difference2dwhere
Other: Clone + Into<Shape2d>,
fn difference<Other>(&self, other: &Other) -> Difference2dwhere
Other: Clone + Into<Shape2d>,
Create a difference between
self
and other