pub struct Profile2D {
pub outer: Vec<Point2<f64>>,
pub holes: Vec<Vec<Point2<f64>>>,
}Expand description
2D Profile with optional holes
Fields§
§outer: Vec<Point2<f64>>Outer boundary (counter-clockwise)
holes: Vec<Vec<Point2<f64>>>Holes (clockwise)
Implementations§
Source§impl Profile2D
impl Profile2D
Sourcepub fn center_on_bbox(&mut self)
pub fn center_on_bbox(&mut self)
Translate the profile so the centre of its outer bounding box sits at the origin.
IFC parameterised profiles (I/U/L/T/C/Z/…) are defined centred on their
bounding box, and the swept-area Position placement is applied relative
to that centred origin. Some per-shape builders are easier to read when
written from a corner; centring them here in one place keeps every
parametric profile consistent with the spec. Holes are shifted by the same
offset so they stay aligned with the outer boundary. No-op for profiles
that are already centred.
Sourcepub fn triangulate(&self) -> Result<Triangulation>
pub fn triangulate(&self) -> Result<Triangulation>
Triangulate the profile using earcutr Returns triangle indices into the flattened vertex array
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profile2D
impl RefUnwindSafe for Profile2D
impl Send for Profile2D
impl Sync for Profile2D
impl Unpin for Profile2D
impl UnsafeUnpin for Profile2D
impl UnwindSafe for Profile2D
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
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>
Converts
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>
Converts
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
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.