[][src]Trait lyon_algorithms::walk::Pattern

pub trait Pattern {
    fn next(
        &mut self,
        position: Point,
        tangent: Vector,
        distance: f32
    ) -> Option<f32>; }

Types implementing the Pattern can be used to walk along a path at constant speed.

At each step, the pattern receives the position, tangent and already traversed distance along the path and returns the distance until the next step.

See the RegularPattern and RepeatedPattern implementations. This trait is also implemented for all functions/closures with signature FnMut(Point, Vector, f32) -> Option<f32>.

Required methods

fn next(
    &mut self,
    position: Point,
    tangent: Vector,
    distance: f32
) -> Option<f32>

This method is invoked at each step along the path.

If this method returns None, path walking stops.

Loading content...

Implementors

impl<'l, Cb> Pattern for RepeatedPattern<'l, Cb> where
    Cb: FnMut(Point, Vector, f32) -> bool
[src]

impl<Cb> Pattern for RegularPattern<Cb> where
    Cb: FnMut(Point, Vector, f32) -> bool
[src]

impl<Cb> Pattern for Cb where
    Cb: FnMut(Point, Vector, f32) -> Option<f32>, 
[src]

Loading content...