Struct centerline::Centerline

source ·
pub struct Centerline<I: InputType, T: GenericVector3>
where T::Scalar: OutputType,
{ pub segments: Vec<Line<I>>, pub diagram: SyncDiagram<T::Scalar>, pub lines: Option<Vec<Line3<T>>>, pub line_strings: Option<Vec<Vec<T>>>, /* private fields */ }
Expand description

Center line calculation object. It: * calculates the segmented voronoi diagram. * Filter out voronoi edges based on the angle to input geometry. * Collects connected edges into line strings and line segments. * Performs line simplification on those line strings.

Fields§

§segments: Vec<Line<I>>

the input data to the voronoi diagram

§diagram: SyncDiagram<T::Scalar>

the voronoi diagram itself

§lines: Option<Vec<Line3<T>>>

the individual two-point edges

§line_strings: Option<Vec<Vec<T>>>

concatenated connected edges

Implementations§

source§

impl<I, T3: GenericVector3> Centerline<I, T3>
where T3::Scalar: OutputType, I: AsPrimitive<T3::Scalar> + InputType,

source

pub fn with_segments(segments: Vec<Line<I>>) -> Self

Creates a Centerline container with a set of segments

source

pub fn build_voronoi(&mut self) -> Result<(), CenterlineError>

builds the voronoi diagram and filter out infinite edges and other ‘outside’ geometry

source

pub fn calculate_centerline( &mut self, cos_angle: T3::Scalar, discrete_limit: T3::Scalar, ignored_regions: Option<&Vec<(Aabb2<T3::Vector2>, Vec<T3::Vector2>)>> ) -> Result<(), CenterlineError>

perform the angle-to-geometry test and filter out some edges. Collect the rest of the edges into connected line-strings and line segments.

source

pub fn calculate_centerline_mesh( &mut self, discrete_limit: T3::Scalar, ignored_regions: Option<&Vec<(Aabb2<T3::Vector2>, Vec<T3::Vector2>)>> ) -> Result<(), CenterlineError>

Collects lines and linestrings from the centerline. This version of calculate_centerline() tries to keep as many edges as possible. The intention is to use the data for mesh generation. TODO: make this return a true mesh

source

pub fn ignored_edges(&self) -> Option<Vob<u32>>

returns a copy of the ignored edges bit field

source

pub fn rejected_edges(&self) -> Option<Vob<u32>>

returns a copy of the rejected edges bit field

source

pub fn retrieve_point( &self, cell_id: CellIndex ) -> Result<Point<I>, CenterlineError>

source

pub fn retrieve_segment( &self, cell_id: CellIndex ) -> Result<Line<I>, CenterlineError>

source

pub fn diagram(&self) -> &SyncDiagram<T3::Scalar>

returns a reference to the internal voronoi diagram

Trait Implementations§

source§

impl<I: InputType, T3: GenericVector3> Default for Centerline<I, T3>
where T3::Scalar: OutputType,

source§

fn default() -> Self

Creates a Centerline container with a set of segments

Auto Trait Implementations§

§

impl<I, T> RefUnwindSafe for Centerline<I, T>

§

impl<I, T> Send for Centerline<I, T>
where I: Send,

§

impl<I, T> Sync for Centerline<I, T>

§

impl<I, T> Unpin for Centerline<I, T>
where T: Unpin,

§

impl<I, T> UnwindSafe for Centerline<I, T>
where I: UnwindSafe, T: UnwindSafe, <T as HasXY>::Scalar: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.