[−][src]Enum beziercurve_wkt::BezierCurveItem
Variants
Line(Line)
QuadraticCurve(QuadraticCurve)
CubicCurve(CubicCurve)
Methods
impl BezierCurveItem
[src]
pub fn get_first_point(&self) -> Point
[src]
Returns the start point of the curve
pub fn get_last_point(&self) -> Point
[src]
Returns the end point of the curve
pub fn from_str(s: &str) -> Result<Self, ParseError>
[src]
Parses the BezierCurveItem
from a string
let parsed1 = BezierCurveItem::from_str("(0.0 1.0, 2.0 1.0)").unwrap(); assert_eq!(parsed1, Line((Point { x: 0.0, y: 1.0 }, Point { x: 2.0, y: 1.0 }))); let parsed2 = BezierCurveItem::from_str("(0.0 1.0, 2.0 1.0, 3.0 4.0)").unwrap(); assert_eq!(parsed2, QuadraticCurve((Point { x: 0.0, y: 1.0 }, Point { x: 2.0, y: 1.0 }, Point { x: 3.0, y: 4.0 })));
pub fn get_max_x(&self) -> f64
[src]
Returns the x
max
value of the BezierCurveItem
- useful for calculating bounding boxes
pub fn get_min_x(&self) -> f64
[src]
Returns the x
min
value of the BezierCurveItem
- useful for calculating bounding boxes
pub fn get_max_y(&self) -> f64
[src]
Returns the y
max
value of the BezierCurveItem
- useful for calculating bounding boxes
pub fn get_min_y(&self) -> f64
[src]
Returns the y
min
value of the BezierCurveItem
- useful for calculating bounding boxes
pub fn get_bbox(&self) -> Bbox
[src]
Returns the bounding box of this item
pub fn intersect(&self, curve: &Self) -> IntersectionResult
[src]
Returns the intersection of two items (line-curve, curve-curve or line-line intersection).
Warning: calling this function is expensive, it's recommended to cull items that don't intersect first by intersecting their bounding boxes.
pub fn normal(&self, t: f64) -> BezierNormalVector
[src]
Returns the normal of the curve / line at t
pub fn split_at(&self, t: f64) -> (Self, Self)
[src]
Splits the curve / line into two curves / lines
Trait Implementations
impl Clone for BezierCurveItem
[src]
fn clone(&self) -> BezierCurveItem
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for BezierCurveItem
[src]
impl Debug for BezierCurveItem
[src]
impl Display for BezierCurveItem
[src]
impl PartialEq<BezierCurveItem> for BezierCurveItem
[src]
fn eq(&self, other: &BezierCurveItem) -> bool
[src]
fn ne(&self, other: &BezierCurveItem) -> bool
[src]
impl PartialOrd<BezierCurveItem> for BezierCurveItem
[src]
fn partial_cmp(&self, other: &BezierCurveItem) -> Option<Ordering>
[src]
fn lt(&self, other: &BezierCurveItem) -> bool
[src]
fn le(&self, other: &BezierCurveItem) -> bool
[src]
fn gt(&self, other: &BezierCurveItem) -> bool
[src]
fn ge(&self, other: &BezierCurveItem) -> bool
[src]
impl StructuralPartialEq for BezierCurveItem
[src]
Auto Trait Implementations
impl RefUnwindSafe for BezierCurveItem
impl Send for BezierCurveItem
impl Sync for BezierCurveItem
impl Unpin for BezierCurveItem
impl UnwindSafe for BezierCurveItem
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,