Struct piet_common::kurbo::Line [−]
A single line.
Fields
p0: Point
The line’s start point.
p1: Point
The line’s end point.
Implementations
impl Line
pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Line
Create a new line.
pub fn length(self) -> f64
The length of the line.
pub fn is_finite(self) -> bool
Is this line finite?
pub fn is_nan(self) -> bool
Is this line NaN?
Trait Implementations
impl Add<Vec2> for Line
type Output = Line
The resulting type after applying the +
operator.
pub fn add(self, v: Vec2) -> Line
impl Clone for Line
pub fn clone(&self) -> Line
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Line
impl Debug for Line
impl From<Line> for PathSeg
impl Mul<Line> for Affine
type Output = Line
The resulting type after applying the *
operator.
pub fn mul(self, other: Line) -> Line
impl Mul<Line> for TranslateScale
type Output = Line
The resulting type after applying the *
operator.
pub fn mul(self, other: Line) -> Line
impl ParamCurve for Line
pub fn eval(&self, t: f64) -> Point
pub fn start(&self) -> Point
pub fn end(&self) -> Point
pub fn subsegment(&self, range: Range<f64>) -> Line
pub fn subdivide(&self) -> (Self, Self)
impl ParamCurveArclen for Line
pub fn arclen(&self, _accuracy: f64) -> f64
pub fn inv_arclen(&self, arclen: f64, _accuracy: f64) -> f64
impl ParamCurveArea for Line
pub fn signed_area(&self) -> f64
impl ParamCurveCurvature for Line
impl ParamCurveDeriv for Line
type DerivResult = ConstPoint
The parametric curve obtained by taking the derivative of this one.
pub fn deriv(&self) -> ConstPoint
pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
impl ParamCurveExtrema for Line
pub fn extrema(&self) -> ArrayVec<[f64; 4]>
pub fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
pub fn bounding_box(&self) -> Rect
impl ParamCurveNearest for Line
impl PartialEq<Line> for Line
impl Shape for Line
type PathElementsIter = LinePathIter
The iterator returned by the path_elements
method. Read more
pub fn path_elements(&self, _tolerance: f64) -> LinePathIter
pub 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.
pub fn perimeter(&self, _accuracy: f64) -> f64
pub fn winding(&self, _pt: Point) -> i32
Same consideration as area
.
pub fn bounding_box(&self) -> Rect
pub fn as_line(&self) -> Option<Line>
pub fn to_path(&self, tolerance: f64) -> BezPath
pub fn into_path(self, tolerance: f64) -> BezPath
pub fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
pub fn contains(&self, pt: Point) -> bool
pub fn as_rect(&self) -> Option<Rect>
pub fn as_rounded_rect(&self) -> Option<RoundedRect>
pub fn as_circle(&self) -> Option<Circle>
pub fn as_path_slice(&self) -> Option<&[PathEl]>
impl StructuralPartialEq for Line
impl Sub<Vec2> 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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
[src]
pub fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,
pub fn round_into(self) -> U
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,