pub struct Polyline {
pub points: Vec<Point>,
pub parameters: Vec<f64>,
pub deflection_met: bool,
}Expand description
A curve approximated by points, with the parameters they came from.
The parameters are kept, not discarded, because the pcurve of the same edge on an adjacent face has to be sampled at exactly these values for the two faces to meet.
Fields§
§points: Vec<Point>The points, in order along the curve.
parameters: Vec<f64>The parameter each point came from.
deflection_met: boolWhether the requested deflection was actually achieved.
false when the segment ceiling was reached first. Reporting it beats
silently returning a coarser polyline than asked for, which would make
a downstream tolerance claim untrue with nothing to show why.
Implementations§
Source§impl Polyline
impl Polyline
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Number of segments.
Sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
Total length of the polyline.
An underestimate of the curve’s own length, since a chord is shorter than the arc it spans, and one that improves as the deflection tightens.
Sourcepub fn is_closed(&self, tol: Tolerances) -> bool
pub fn is_closed(&self, tol: Tolerances) -> bool
Whether the polyline returns to where it started.
Trait Implementations§
impl StructuralPartialEq for Polyline
Auto Trait Implementations§
impl Freeze for Polyline
impl RefUnwindSafe for Polyline
impl Send for Polyline
impl Sync for Polyline
impl Unpin for Polyline
impl UnsafeUnpin for Polyline
impl UnwindSafe for Polyline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.