Enum rasterize::Segment [−][src]
Expand description
Segment is an enum of either Line, Quad or Cubic
Variants
Line(Line)Tuple Fields of Line
0: LineQuad(Quad)Tuple Fields of Quad
0: QuadCubic(Cubic)Tuple Fields of Cubic
0: CubicImplementations
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 cubic if it is a cubic variant of the segment
pub fn line_join(
self,
other: Segment,
stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
pub fn line_join(
self,
other: Segment,
stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
Produce iterator over segments that join to segments with the specified method.
pub fn line_cap(
self,
other: Segment,
stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
pub fn line_cap(
self,
other: Segment,
stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
Produce and iterator over segments that adds caps between two segments
Trait Implementations
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
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
fn flatten(&self, tr: Transform, flatness: Scalar) -> CurveFlattenIterⓘNotable traits for CurveFlattenIterimpl Iterator for CurveFlattenIter type Item = Line;
fn flatten(&self, tr: Transform, flatness: Scalar) -> CurveFlattenIterⓘNotable traits for CurveFlattenIterimpl Iterator for CurveFlattenIter type Item = Line;
impl Iterator for CurveFlattenIter type Item = Line;Convert curve to an iterator over line segments with desired flatness
Auto Trait Implementations
impl RefUnwindSafe for Segment
impl UnwindSafe for Segment
Blanket Implementations
Mutably borrows from an owned value. Read more