Skip to main content

ExpandCtx

Struct ExpandCtx 

Source
struct ExpandCtx {
    expand: Diagonal2,
    join: Join,
    miter_limit: f64,
    tolerance: f64,
    result: BezPath,
    first_n: Option<Vec2>,
    first_tan: Vec2,
    last_pt: Point,
    last_n: Option<Vec2>,
    last_tan: Vec2,
}

Fields§

§expand: Diagonal2§join: Join§miter_limit: f64§tolerance: f64§result: BezPath§first_n: Option<Vec2>§first_tan: Vec2§last_pt: Point§last_n: Option<Vec2>§last_tan: Vec2

Implementations§

Source§

impl ExpandCtx

Source

fn in_tolerance(&self, v: Vec2) -> bool

Helper function to determine if a distance is within tolerance.

Source

fn do_line(&mut self, p1: Point)

Process a line segment. Includes initial join.

Source

fn do_quad(&mut self, p1: Point, p2: Point)

Process a quadratic Bézier segment. Includes initial join.

Source

fn do_cubic(&mut self, p1: Point, p2: Point, p3: Point)

Process a cubic segment. Includes initial join.

Source

fn do_join(&mut self, n: Vec2, tan: Vec2, is_line: bool)

Do a join.

The tan parameter is a vector tangent to the start of the new segment. The n parameter is the normal vector (turned tangent) scaled by the expansion.

Source

fn do_close_path(&mut self, first_pt: Point)

Close an open subpath if there is one; no-op if already closed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.