[][src]Struct beziercurve_wkt::BezierCurve

pub struct BezierCurve {
    pub items: Vec<BezierCurveItem>,
}

Fields

items: Vec<BezierCurveItem>

Methods

impl BezierCurve[src]

pub fn from_str(s: &str) -> Result<Self, ParseErrorWithContext>[src]

Parses a BezierCurve from a str

let s = "BEZIERCURVE((0.0 1.0, 2.0 1.0), (2.0 1.0, 3.0 4.0, 0.0 0.0), (0.0 0.0, 0.0 1.0))";
let parsed_curve = BezierCurve::from_str(s).unwrap();

assert_eq!(parsed_curve, BezierCurve { items: vec![
     BezierCurveItem::Line((Point { x: 0.0, y: 1.0 }, Point { x: 2.0, y: 1.0 })),
     BezierCurveItem::QuadraticCurve((Point { x: 2.0, y: 1.0 }, Point { x: 3.0, y: 4.0 }, Point { x: 0.0, y: 0.0 })),
     BezierCurveItem::Line((Point { x: 0.0, y: 0.0 }, Point { x: 0.0, y: 1.0 })),
]});

assert!(parsed_curve.is_closed());

pub fn get_bbox(&self) -> Bbox[src]

pub fn is_closed(&self) -> bool[src]

Returns whether the bezier curve is closed

pub fn cache(self) -> BezierCurveCache[src]

Builds a quadtree-based cache from the current bezier curve

pub fn get_commands(&self) -> Vec<BezierCommand>[src]

Turn the line into a SVG-esque sequence of "moveto x y, lineto x y"

Trait Implementations

impl Clone for BezierCurve[src]

impl Debug for BezierCurve[src]

impl Display for BezierCurve[src]

impl Index<CurveIndex> for BezierCurve[src]

type Output = BezierCurveItem

The returned type after indexing.

impl IndexMut<CurveIndex> for BezierCurve[src]

impl PartialEq<BezierCurve> for BezierCurve[src]

impl PartialOrd<BezierCurve> for BezierCurve[src]

impl StructuralPartialEq for BezierCurve[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.