pub struct ArcVertex {
pub point: DVec2,
pub bulge: f64,
}Expand description
One boundary vertex and the bulge of the edge leaving it.
The bulge describes the edge from this vertex to the NEXT one, so a
ring of n vertices has exactly n edges and needs no separate edge
list. Storing it per departing vertex keeps insertion and reversal
local operations rather than re-indexing an edge array.
Fields§
§point: DVec2Vertex position.
bulge: f64tan(theta / 4) for the edge leaving point; 0 means straight.
Implementations§
Source§impl ArcVertex
impl ArcVertex
Sourcepub const fn straight(point: DVec2) -> ArcVertex
pub const fn straight(point: DVec2) -> ArcVertex
A vertex whose departing edge is a straight segment.
Sourcepub const fn bulged(point: DVec2, bulge: f64) -> ArcVertex
pub const fn bulged(point: DVec2, bulge: f64) -> ArcVertex
A vertex whose departing edge bulges by bulge.
Sourcepub fn is_straight(&self) -> bool
pub fn is_straight(&self) -> bool
True when the departing edge is straight.
Exact comparison is deliberate: a bulge is either exactly zero, in which case the edge IS a segment, or it is an arc whose radius is whatever the value implies. Treating tiny bulges as straight would silently discard curvature the caller asked for.
Trait Implementations§
impl Copy for ArcVertex
impl StructuralPartialEq for ArcVertex
Auto Trait Implementations§
impl Freeze for ArcVertex
impl RefUnwindSafe for ArcVertex
impl Send for ArcVertex
impl Sync for ArcVertex
impl Unpin for ArcVertex
impl UnwindSafe for ArcVertex
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more