pub enum Curve {
Line(Segment),
Arc(Arc),
Circle(Circle),
Cubic(CubicBez),
}Expand description
One elementary curve piece. Shapes decompose into these for intersections, trimming, hit-testing and tessellation.
Variants§
Line(Segment)
Straight segment.
Arc(Arc)
Circular arc.
Circle(Circle)
Full circle (closed, parameter = angle / 2π).
Cubic(CubicBez)
Cubic Bézier (quadratics are elevated exactly).
Implementations§
Source§impl Curve
impl Curve
Sourcepub fn distance_to_point(&self, p: Point) -> f64
pub fn distance_to_point(&self, p: Point) -> f64
Distance to p.
Sourcepub fn flatten_into(&self, tol: f64, out: &mut Vec<Point>)
pub fn flatten_into(&self, tol: f64, out: &mut Vec<Point>)
Append flattened points (excluding the start point) to out.
Sourcepub fn tangent_at(&self, t: f64) -> Option<Vector>
pub fn tangent_at(&self, t: f64) -> Option<Vector>
Unit tangent at t (None where the derivative vanishes).
Trait Implementations§
impl Copy for Curve
Source§impl<'de> Deserialize<'de> for Curve
impl<'de> Deserialize<'de> for Curve
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
impl StructuralPartialEq for Curve
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnsafeUnpin for Curve
impl UnwindSafe for Curve
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