pub trait BezierCurve: Geo + Clone + Sized {
    fn start_point(&self) -> Self::Point;
    fn end_point(&self) -> Self::Point;
    fn control_points(&self) -> (Self::Point, Self::Point);

    fn reverse<Curve: BezierCurveFactory<Point = Self::Point>>(self) -> Curve { ... }
    fn point_at_pos(&self, t: f64) -> Self::Point { ... }
    fn t_for_point(&self, point: &Self::Point) -> Option<f64> { ... }
    fn subdivide<Curve: BezierCurveFactory<Point = Self::Point>>(
        &self,
        t: f64
    ) -> (Curve, Curve) { ... } fn bounding_box<Bounds: BoundingBox<Point = Self::Point>>(&self) -> Bounds { ... } fn fast_bounding_box<Bounds: BoundingBox<Point = Self::Point>>(
        &self
    ) -> Bounds { ... } fn search_with_bounds<MatchFn: Fn(Self::Point, Self::Point) -> bool>(
        &self,
        max_error: f64,
        match_fn: MatchFn
    ) -> Vec<f64> { ... } fn find_extremities(&self) -> Vec<f64> { ... } fn estimate_length(&self, max_t: f64) -> f64 { ... } }
Expand description

Trait implemented by things representing a cubic bezier curve

Required Methods

The start point of this curve

The end point of this curve

The control points in this curve

Provided Methods

Reverses the direction of this curve

Given a value t from 0 to 1, returns a point on this curve

Given a point that is on or very close to the curve, returns the t value where the point can be found (or None if the point is not very close to the curve)

Given a value t from 0 to 1, finds a point on this curve and subdivides it, returning the two resulting curves

Computes the bounds of this bezier curve

Faster but less accurate bounding box for a curve

This will produce a bounding box that contains the curve but which may be larger than necessary

Given a function that determines if a searched-for point is within a bounding box, searches the curve for the t values for the corresponding points

Finds the t values where this curve has extremities

Attempts to estimate the length of this curve

Implementors