pub struct ContourSet {
pub rings: Vec<Ring2D>,
pub shape_offsets: Vec<usize>,
}Expand description
The result of a contour-set boolean: rings grouped into disjoint shapes.
Unlike Profile2D this holds any number of
shapes, so a difference that splits its subject into islands loses nothing.
Fields§
§rings: Vec<Ring2D>Every boundary ring, laid out shape by shape.
shape_offsets: Vec<usize>shape_offsets[s] is the index in rings of shape s’s
OUTER ring; the rings from there to the next offset (or the end) are
that shape’s holes. Length == number of disjoint shapes.
Implementations§
Source§impl ContourSet
impl ContourSet
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when the set holds no boundary rings. Every ContourSet produced
by this module — a boolean result, or a soup that has been through
sanitize (which the WASM constructor applies) — has had its
non-contributing rings (under 3 vertices, non-finite, or exactly collinear)
dropped, so for those this also means it covers no area.
Sourcepub fn shape_count(&self) -> usize
pub fn shape_count(&self) -> usize
Number of disjoint shapes.
Trait Implementations§
Source§impl Clone for ContourSet
impl Clone for ContourSet
Source§fn clone(&self) -> ContourSet
fn clone(&self) -> ContourSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContourSet
impl Debug for ContourSet
Source§impl Default for ContourSet
impl Default for ContourSet
Source§fn default() -> ContourSet
fn default() -> ContourSet
Source§impl PartialEq for ContourSet
impl PartialEq for ContourSet
impl StructuralPartialEq for ContourSet
Auto Trait Implementations§
impl Freeze for ContourSet
impl RefUnwindSafe for ContourSet
impl Send for ContourSet
impl Sync for ContourSet
impl Unpin for ContourSet
impl UnsafeUnpin for ContourSet
impl UnwindSafe for ContourSet
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.