pub enum DrawingShape {
Polyline {
points: Vec<[f64; 2]>,
bulges: Vec<f64>,
closed: bool,
},
Arc {
centre: [f64; 2],
radius: f64,
start_angle: f64,
end_angle: f64,
},
Circle {
centre: [f64; 2],
radius: f64,
},
Ellipse {
centre: [f64; 2],
major: [f64; 2],
ratio: f64,
start_param: f64,
end_param: f64,
},
Spline {
points: Vec<[f64; 2]>,
closed: bool,
},
}Expand description
The kinds of curve a drawing carries. Angles are radians, arcs run counter-clockwise.
Variants§
Polyline
Points in order, each segment a line, or an arc where the bulge of
the segment starting at that point (the tangent of a quarter of its
included angle, positive counter-clockwise) is not zero. bulges
is as long as points, or empty for straight segments only.
Arc
Circle
Ellipse
Points centre + major cos t + ratio perp(major) sin t for t
from start_param to end_param; the whole ellipse when those span
a full turn.
Spline
A spline, as points along the exact curve.
Trait Implementations§
Source§impl Clone for DrawingShape
impl Clone for DrawingShape
Source§impl Debug for DrawingShape
impl Debug for DrawingShape
Source§impl<'de> Deserialize<'de> for DrawingShape
impl<'de> Deserialize<'de> for DrawingShape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DrawingShape
impl PartialEq for DrawingShape
Source§impl Serialize for DrawingShape
impl Serialize for DrawingShape
impl StructuralPartialEq for DrawingShape
Auto Trait Implementations§
impl Forget for DrawingShape
impl Freeze for DrawingShape
impl Move for DrawingShape
impl RefUnwindSafe for DrawingShape
impl Send for DrawingShape
impl Sync for DrawingShape
impl Unpin for DrawingShape
impl UnsafeUnpin for DrawingShape
impl UnwindSafe for DrawingShape
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