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>
impl<I, T3: GenericVector3> Centerline<I, T3>
sourcepub fn with_segments(segments: Vec<Line<I>>) -> Self
pub fn with_segments(segments: Vec<Line<I>>) -> Self
Creates a Centerline container with a set of segments
sourcepub fn build_voronoi(&mut self) -> Result<(), CenterlineError>
pub fn build_voronoi(&mut self) -> Result<(), CenterlineError>
builds the voronoi diagram and filter out infinite edges and other ‘outside’ geometry
sourcepub 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>
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.
sourcepub fn calculate_centerline_mesh(
&mut self,
discrete_limit: T3::Scalar,
ignored_regions: Option<&Vec<(Aabb2<T3::Vector2>, Vec<T3::Vector2>)>>
) -> Result<(), CenterlineError>
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
sourcepub fn ignored_edges(&self) -> Option<Vob<u32>>
pub fn ignored_edges(&self) -> Option<Vob<u32>>
returns a copy of the ignored edges bit field
sourcepub fn rejected_edges(&self) -> Option<Vob<u32>>
pub fn rejected_edges(&self) -> Option<Vob<u32>>
returns a copy of the rejected edges bit field