#[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§
source§impl Sketch
impl Sketch
sourcepub fn from_segments(segments: Vec<SketchSegment>) -> Option<Self>
pub fn from_segments(segments: Vec<SketchSegment>) -> Option<Self>
Create a sketch made of sketch segments
sourcepub fn from_points(points: Vec<[f64; 2]>) -> Option<Self>
pub fn from_points(points: Vec<[f64; 2]>) -> Option<Self>
Create a sketch made of straight lines 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§
source§impl PartialEq<Sketch> for Sketch
impl PartialEq<Sketch> for Sketch
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§
source§impl<T> Difference for Twhere
T: Clone + Into<Shape2d>,
impl<T> Difference for Twhere T: Clone + Into<Shape2d>,
source§fn 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