Enum rasterize::Segment [−][src]
Segment
is an enum of either Line
, Quad
or Cubic
Variants
Line(Line)
Quad(Quad)
Cubic(Cubic)
Implementations
impl Segment
[src]
impl Segment
[src]pub fn ends(&self) -> (Line, Line)
[src]
pub fn intersect(
self,
other: impl Into<Segment>,
tolerance: Scalar
) -> Vec<Point>
[src]
self,
other: impl Into<Segment>,
tolerance: Scalar
) -> Vec<Point>
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.
pub fn to_line(&self) -> Option<Line>
[src]
Convert to line if it is a line variant of the segment
pub fn to_quad(&self) -> Option<Quad>
[src]
Convert to quad if it is a quad variant of the segment
pub fn to_cubic(&self) -> Option<Cubic>
[src]
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>
[src]
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>
[src]
self,
other: Segment,
stroke_style: StrokeStyle
) -> impl Iterator<Item = Self>
Produce and iterator over segments that adds caps between two segments
Trait Implementations
impl Curve for Segment
[src]
impl Curve for Segment
[src]fn flatness(&self) -> Scalar
[src]
fn transform(&self, tr: Transform) -> Self
[src]
fn start(&self) -> Point
[src]
fn end(&self) -> Point
[src]
fn at(&self, t: Scalar) -> Point
[src]
fn deriv(&self) -> Segment
[src]
fn split_at(&self, t: Scalar) -> (Self, Self)
[src]
fn cut(&self, a: Scalar, b: Scalar) -> Self
[src]
fn bbox(&self, init: Option<BBox>) -> BBox
[src]
fn offset(&self, dist: Scalar, out: &mut impl Extend<Segment>)
[src]
fn reverse(&self) -> Self
[src]
fn roots(&self) -> CurveRoots
[src]
fn extremities(&self) -> CurveExtremities
[src]
fn length(&self, t0: Scalar, t1: Scalar) -> Scalar
[src]
fn flatten(&self, tr: Transform, flatness: Scalar) -> CurveFlattenIterⓘNotable traits for CurveFlattenIter
impl Iterator for CurveFlattenIter type Item = Line;
[src]
Notable traits for CurveFlattenIter
impl Iterator for CurveFlattenIter type Item = Line;
fn split(&self) -> (Self, Self)
[src]
fn from_length(&self, l: Scalar, error: Option<Scalar>) -> Scalar
[src]
impl StructuralPartialEq for Segment
[src]
impl StructuralPartialEq for Segment
[src]Auto Trait Implementations
impl RefUnwindSafe for Segment
impl RefUnwindSafe for Segment
impl UnwindSafe for Segment
impl UnwindSafe for Segment