pub struct ArcRing {
pub vertices: Vec<ArcVertex>,
}Expand description
A closed boundary whose edges may be arcs.
Always closed: the edge leaving the last vertex returns to the first.
An explicitly repeated closing vertex is therefore a zero-length edge
and is refused by validate_arc_ring.
Fields§
§vertices: Vec<ArcVertex>Boundary vertices in order.
Implementations§
Source§impl ArcRing
impl ArcRing
Sourcepub fn from_points(points: &[Point2]) -> Self
pub fn from_points(points: &[Point2]) -> Self
Build a straight-edged ring, the polygonal case.
Sourcepub fn circle(centre: Point2, radius: f64) -> Self
pub fn circle(centre: Point2, radius: f64) -> Self
A full circle as two semicircular edges.
Two vertices is the minimum honest encoding of a circle: one vertex
would make the chord degenerate and the centre ambiguous, which is
why validate_arc_ring requires at least two.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Number of edges, which equals the number of vertices.
Sourcepub fn is_polygonal(&self) -> bool
pub fn is_polygonal(&self) -> bool
True when every edge is straight.
Trait Implementations§
impl StructuralPartialEq for ArcRing
Auto Trait Implementations§
impl Freeze for ArcRing
impl RefUnwindSafe for ArcRing
impl Send for ArcRing
impl Sync for ArcRing
impl Unpin for ArcRing
impl UnwindSafe for ArcRing
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
Mutably borrows from an owned value. Read more