Struct lyon_algorithms::splitter::Splitter
source · pub struct Splitter { /* private fields */ }
Expand description
A context object that can split paths.
When splitting several paths, reusing the Splitter
object can improve performance
by reusing memory allocations.
Implementations§
source§impl Splitter
impl Splitter
sourcepub fn set_flattening_tolerance(&mut self, tolerance: f32)
pub fn set_flattening_tolerance(&mut self, tolerance: f32)
Sets the flattening tolerance that will be used to approximate curves if any.
sourcepub fn split_with_segment<'l, P>(
&mut self,
path: P,
segment: &LineSegment<f32>
) -> (Path, Path)
pub fn split_with_segment<'l, P>( &mut self, path: P, segment: &LineSegment<f32> ) -> (Path, Path)
Splits a path using a line segment.
Returns two Path
objects, the first one being on the positive
side of the line, and the other one on the negative side.
“positive” and “negative” in this context refer to the sign of the cross product between a vector going from the splitting line to the path and the vector of the splitting line.
Curves are flattened.
sourcepub fn split_with_line<'l, P>(
&mut self,
path: P,
line: &Line<f32>
) -> (Path, Path)
pub fn split_with_line<'l, P>( &mut self, path: P, line: &Line<f32> ) -> (Path, Path)
Splits a path using a line.
Returns two Path
objects, the first one being on the positive
side of the line, and the other one on the negative side.
“positive” and “negative” in this context refer to the sign of the cross product between a vector going from the splitting line to the path and the vector of the splitting line.
Curves are flattened.