pub struct ArcVertex {
pub point: Point2,
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: Point2Vertex position.
bulge: f64tan(theta / 4) for the edge leaving point; 0 means straight.
Implementations§
Source§impl ArcVertex
impl ArcVertex
Sourcepub const fn straight(point: Point2) -> Self
pub const fn straight(point: Point2) -> Self
A vertex whose departing edge is a straight segment.
Sourcepub const fn bulged(point: Point2, bulge: f64) -> Self
pub const fn bulged(point: Point2, bulge: f64) -> Self
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.