Enum rasterize::Segment[][src]

pub enum Segment {
    Line(Line),
    Quad(Quad),
    Cubic(Cubic),
}
Expand description

Segment is an enum of either Line, Quad or Cubic

Variants

Line(Line)

Tuple Fields of Line

0: Line
Quad(Quad)

Tuple Fields of Quad

0: Quad
Cubic(Cubic)

Tuple Fields of Cubic

0: Cubic

Implementations

Find intersection between two segments

This might not be the fastest method possible but works for any two curves. Divide cuves as long as there is intersection between bounding boxes, if the intersection is smaller then tolerance we can treat it as an intersection point.

Convert to line if it is a line variant of the segment

Convert to quad if it is a quad variant of the segment

Convert to cubic if it is a cubic variant of the segment

Produce iterator over segments that join to segments with the specified method.

Produce and iterator over segments that adds caps between two segments

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Correspond to maximum diviation of the curve from the straight line f = max |curve(t) - line(curve_start, curve_end)(t)|. This function actually returns 16.0 * f^2 to avoid unneeded division and square root. Read more

Apply affine transformation to the curve

Point at which curve starts

Point at which curve ends

Evaluate curve at parameter value t in (0.0..=1.0)

Derivative with respect to t, deriv(t) = [curve'(t)_x, curve'(t)_y]

Split the curve at prameter value t

Create subcurve specified starting at parameter value a and ending at value b

Extend provided init bounding box with the bounding box of the curve

Offset the curve by distance dist, result is inserted into out container

Identical curve but directed from end to start, instead of start to end.

Find roots of the equation curve(t)_y = 0. Values of the parameter at which curve crosses y axis. Read more

Find all extermities of the curve curve'(t)_x = 0 || curve'(t)_y = 0

Calculate length of the curve from t0 to t1

Convert curve to an iterator over line segments with desired flatness

Optimized version of Curve::split_at(0.5)

Find value of parameter t given desired l length of the segment Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.