[][src]Trait flo_curves::bezier::BezierCurve

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 { ... }
fn section<'a>(&'a self, t_min: f64, t_max: f64) -> CurveSection<'a, Self> { ... } }

Trait implemented by things representing a cubic bezier curve

Required methods

fn start_point(&self) -> Self::Point

The start point of this curve

fn end_point(&self) -> Self::Point

The end point of this curve

fn control_points(&self) -> (Self::Point, Self::Point)

The control points in this curve

Loading content...

Provided methods

fn reverse<Curve: BezierCurveFactory<Point = Self::Point>>(self) -> Curve

Reverses the direction of this curve

fn point_at_pos(&self, t: f64) -> Self::Point

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

fn t_for_point(&self, point: &Self::Point) -> Option<f64>

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)

fn subdivide<Curve: BezierCurveFactory<Point = Self::Point>>(
    &self,
    t: f64
) -> (Curve, Curve)

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

fn bounding_box<Bounds: BoundingBox<Point = Self::Point>>(&self) -> Bounds

Computes the bounds of this bezier curve

fn fast_bounding_box<Bounds: BoundingBox<Point = Self::Point>>(&self) -> Bounds

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

fn search_with_bounds<MatchFn: Fn(Self::Point, Self::Point) -> bool>(
    &self,
    max_error: f64,
    match_fn: MatchFn
) -> Vec<f64>

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

fn find_extremities(&self) -> Vec<f64>

Finds the t values where this curve has extremities

fn estimate_length(&self, max_t: f64) -> f64

Attempts to estimate the length of this curve

fn section<'a>(&'a self, t_min: f64, t_max: f64) -> CurveSection<'a, Self>

Create a section from this curve. Consider calling subsection for curves that are already CurveSections.

Loading content...

Implementors

impl<'a, C: 'a + BezierCurve> BezierCurve for CurveSection<'a, C>[src]

fn start_point(&self) -> Self::Point[src]

The start point of this curve

fn end_point(&self) -> Self::Point[src]

The end point of this curve

fn control_points(&self) -> (Self::Point, Self::Point)[src]

The control points in this curve

fn point_at_pos(&self, t: f64) -> Self::Point[src]

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

impl<'a, Point: 'a + Coordinate, Label: 'a + Copy> BezierCurve for GraphEdge<'a, Point, Label>[src]

fn start_point(&self) -> Self::Point[src]

The start point of this curve

fn end_point(&self) -> Self::Point[src]

The end point of this curve

fn control_points(&self) -> (Self::Point, Self::Point)[src]

The control points in this curve

fn fast_bounding_box<Bounds: BoundingBox<Point = Self::Point>>(&self) -> Bounds[src]

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

fn bounding_box<Bounds: BoundingBox<Point = Self::Point>>(&self) -> Bounds[src]

Computes the bounds of this bezier curve

impl<Coord: Coordinate> BezierCurve for Curve<Coord>[src]

Loading content...