Struct centerline::LineStringSet2
source · pub struct LineStringSet2<T: GenericVector2> {
pub internals: Option<Vec<(Aabb2<T>, Vec<T>)>>,
/* private fields */
}
Expand description
A set of 2d LineString, an aabb + convex_hull. It also contains a list of aabb & convex_hulls of shapes this set has gobbled up. This can be useful for separating out inner regions of the shape.
This struct is intended to contain related shapes. E.g. outlines of letters with holes
Fields§
§internals: Option<Vec<(Aabb2<T>, Vec<T>)>>
Implementations§
source§impl<T: GenericVector2> LineStringSet2<T>
impl<T: GenericVector2> LineStringSet2<T>
sourcepub fn steal_from(other: &mut LineStringSet2<T>) -> Self
pub fn steal_from(other: &mut LineStringSet2<T>) -> Self
steal the content of ‘other’ leaving it empty
pub fn set(&self) -> &Vec<Vec<T>>
pub fn with_capacity(capacity: usize) -> Self
pub fn get_internals(&self) -> Option<&Vec<(Aabb2<T>, Vec<T>)>>
pub fn is_empty(&self) -> bool
pub fn push(&mut self, ls: Vec<T>)
sourcepub fn get_convex_hull(&self) -> &Option<Vec<T>>
pub fn get_convex_hull(&self) -> &Option<Vec<T>>
returns the combined convex hull of all the shapes in self.set
sourcepub fn calculate_convex_hull(&mut self) -> Result<&Vec<T>, LinestringError>
pub fn calculate_convex_hull(&mut self) -> Result<&Vec<T>, LinestringError>
calculates the combined convex hull of all the shapes in self.set
sourcepub fn copy_to_3d(&self, plane: Plane) -> LineStringSet3<T::Vector3>
pub fn copy_to_3d(&self, plane: Plane) -> LineStringSet3<T::Vector3>
Copy this linestringset2 into a linestringset3, populating the axes defined by ‘plane’ An axis will always try to keep it’s position (e.g. y goes to y if possible). That way the operation is reversible (with regards to axis positions). The empty axis will be set to zero.
sourcepub fn take_from(&mut self, other: Self)
pub fn take_from(&mut self, other: Self)
drains the ‘other’ container of all shapes and put them into ‘self’
sourcepub fn take_from_internal(
&mut self,
other: &mut Self
) -> Result<(), LinestringError>
pub fn take_from_internal( &mut self, other: &mut Self ) -> Result<(), LinestringError>
drains the ‘other’ container of all shapes and put them into ‘self’ The other container must be entirely ‘inside’ the convex hull of ‘self’ The ‘other’ container must also contain valid ‘internals’ and ‘convex_hull’ fields
Trait Implementations§
source§impl<T: Clone + GenericVector2> Clone for LineStringSet2<T>
impl<T: Clone + GenericVector2> Clone for LineStringSet2<T>
source§fn clone(&self) -> LineStringSet2<T>
fn clone(&self) -> LineStringSet2<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more