pub struct Line {
pub p0: Point,
pub p1: Point,
}
Expand description
A single line.
Fields§
§p0: Point
The line’s start point.
p1: Point
The line’s end point.
Implementations§
Trait Implementations§
§impl Mul<Line> for TranslateScale
impl Mul<Line> for TranslateScale
§impl ParamCurve for Line
impl ParamCurve for Line
§fn subsegment(&self, range: Range<f64>) -> Line
fn subsegment(&self, range: Range<f64>) -> Line
Get a subsegment of the curve for the given parameter range.
§fn subdivide(&self) -> (Self, Self)
fn subdivide(&self) -> (Self, Self)
Subdivide into (roughly) halves.
§impl ParamCurveArclen for Line
impl ParamCurveArclen for Line
§impl ParamCurveArea for Line
impl ParamCurveArea for Line
§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more
§impl ParamCurveCurvature for Line
impl ParamCurveCurvature for Line
§impl ParamCurveDeriv for Line
impl ParamCurveDeriv for Line
§type DerivResult = ConstPoint
type DerivResult = ConstPoint
The parametric curve obtained by taking the derivative of this one.
§fn deriv(&self) -> ConstPoint
fn deriv(&self) -> ConstPoint
The derivative of the curve. Read more
§impl ParamCurveExtrema for Line
impl ParamCurveExtrema for Line
§fn extrema(
&self
) -> ArrayVec<f64, kurbo::::line::{impl#7}::extrema::{constant#0}>
fn extrema( &self ) -> ArrayVec<f64, kurbo::::line::{impl#7}::extrema::{constant#0}>
Compute the extrema of the curve. Read more
§fn extrema_ranges(
&self
) -> ArrayVec<Range<f64>, kurbo::::param_curve::ParamCurveExtrema::extrema_ranges::{constant#0}>
fn extrema_ranges( &self ) -> ArrayVec<Range<f64>, kurbo::::param_curve::ParamCurveExtrema::extrema_ranges::{constant#0}>
Return parameter ranges, each of which is monotonic within the range.
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the curve in the range (0..1).
§impl ParamCurveNearest for Line
impl ParamCurveNearest for Line
source§impl Scalable for Line
impl Scalable for Line
§impl Shape for Line
impl Shape for Line
§fn area(&self) -> f64
fn area(&self) -> f64
Returning zero here is consistent with the contract (area is only meaningful for closed shapes), but an argument can be made that the contract should be tightened to include the Green’s theorem contribution.
§type PathElementsIter = LinePathIter
type PathElementsIter = LinePathIter
The iterator returned by the
path_elements
method.§fn path_elements(&self, _tolerance: f64) -> LinePathIter
fn path_elements(&self, _tolerance: f64) -> LinePathIter
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
§fn as_path_slice(&self) -> Option<&[PathEl]>
fn as_path_slice(&self) -> Option<&[PathEl]>
If the shape is stored as a slice of path elements, make
that available. Read more
impl Copy for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.