pub struct SegmentChain(/* private fields */);Expand description
A sequence of Segments where each segment is “connected” to its successor
(end / stop point of a segment is approximately equal to the start point of the
successor).
The approximate equality of start and end point is defined by
DEFAULT_EPSILON and DEFAULT_MAX_ULPS:
approx::ulps_eq!(chain[i].stop(), chain[i+1].start(), epsilon = DEFAULT_EPSILON, max_ulps = DEFAULT_MAX_ULPS)A segment chain can intersect itself (i.e. at least two of its segments
intersect each other). This can be tested using its Composite trait
implementation:
use planar_geo::prelude::*;
let chain = SegmentChain::from_points(&[[0.0, 0.0], [2.0, 2.0], [0.0, 2.0], [2.0, 0.0]]);
assert_eq!(chain.intersections_segment_chain(&chain, 0.0, 0).count(), 1);§Constructing a segment chain
A segment chain is essentially a newtype
wrapper around a VecDeque<Segment> and therefore exposes many of the same
methods. For example, a segment chain can be built via
push_front and
push_back just like a VecDeque. The
extend_front and
extend_back methods can be used to implicitly
add LineSegments.
There are multiple constructors available:
new: A new, empty segment chain with no segment.with_capacity: A new, empty segment chain with a defined space for segments preallocated with no segment.from_points: A segment chain consisting ofLineSegments which connect the given points.from_iter: A segment chain consisting of the segments given by an iterator. In case two subsequent segments are not connected, a “filler”LineSegmentis introduced between them.
§Modifying a segment chain
To uphold the “connection” property, it is not possible to manipulate arbitrary
segments, which is why methods like VecDeque::get_mut are missing.
It is however possible to manipulate the whole segment chain via the
Transformation implementation. Additionally, individual segments can be
removed from the ends of the chain with pop_front
and pop_back.
§Access of individual segments
Accessing individual segments is possible via indexing (which panics when
out-of-bounds) and the get method (which returns None
when out-of-bounds). As in the underlying deque, the segments are not
necessarily contiguous in memory and can generally only be accessed via two
slices with the as_slices method. SegmentChain
does however expose the make_contiguous to
store the segments contiguous in memory.
§Serialization and deserialization
When the serde feature is enabled, a segment chain can be serialized and
deserialized using the serde crate. It uses the same serialized
representation as a VecDeque.
Implementations§
Source§impl SegmentChain
impl SegmentChain
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty SegmentChain.
§Examples
use planar_geo::prelude::SegmentChain;
let chain = SegmentChain::new();Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty SegmentChain with space for at least capacity
Segment.
§Examples
use planar_geo::prelude::SegmentChain;
let chain = SegmentChain::with_capacity(10);Sourcepub fn from_points(points: &[[f64; 2]]) -> Self
pub fn from_points(points: &[[f64; 2]]) -> Self
Creates an SegmentChain of LineSegments from the given points.
If two consecutive points are equal (within the tolerances defined by
DEFAULT_EPSILON and DEFAULT_MAX_ULPS), they are treated as a single
vertex.
§Examples
use planar_geo::prelude::SegmentChain;
// Three points -> Two line segments
let chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]);
assert_eq!(chain.len(), 2);
// Two consecutive points are equal
let chain = SegmentChain::from_points(&[[0.0, 0.0], [0.0, 0.0], [0.0, 1.0]]);
assert_eq!(chain.len(), 1);Sourcepub fn close(&mut self)
pub fn close(&mut self)
“Closes” the SegmentChain by connecting the start point of the first /
“front” segment with the stop point of the last / “back” segment with a
LineSegment (if the two points aren’t already equal).
§Examples
use planar_geo::prelude::SegmentChain;
// Three points -> Two line segments
let mut chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]);
assert_eq!(chain.len(), 2);
// Close the chain
chain.close();
assert_eq!(chain.len(), 3);Sourcepub fn as_slices(&self) -> (&[Segment], &[Segment])
pub fn as_slices(&self) -> (&[Segment], &[Segment])
Calls the VecDeque::as_slices method of the underlying deque. See its
docstring for more.
Sourcepub fn make_contiguous(&mut self) -> &[Segment]
pub fn make_contiguous(&mut self) -> &[Segment]
Calls the VecDeque::make_contiguous method of the underlying deque. See
its docstring for more.
Sourcepub fn push_back(&mut self, segment: Segment)
pub fn push_back(&mut self, segment: Segment)
Appends a Segment to the back of the SegmentChain.
If the chain already has a “back” segment (SegmentChain::back returns
Some), the start point of segment is compared to the stop point of
the back segment. If they aren’t equal within the tolerances defined by
DEFAULT_EPSILON and DEFAULT_MAX_ULPS, a filler line segment is
inserted between the two.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
assert_eq!(chain.len(), 0);
chain.push_back(LineSegment::new([0.0, 0.0], [1.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 1);
// The start point of this segment matches the stop point of the already
// inserted segment
chain.push_back(LineSegment::new([1.0, 0.0], [1.0, 1.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 2);
// Start and stop point don't match -> A filler segment is introduced
chain.push_back(LineSegment::new([2.0, 1.0], [2.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 4);Sourcepub fn push_front(&mut self, segment: Segment)
pub fn push_front(&mut self, segment: Segment)
Prepends a Segment to the front of the SegmentChain.
If the chain already has a “front” segment (SegmentChain::front returns
Some), the stop point of segment is compared to the start point of
the front segment. If they aren’t equal within the tolerances defined by
DEFAULT_EPSILON and DEFAULT_MAX_ULPS, a filler line segment is
inserted between the two.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
assert_eq!(chain.len(), 0);
chain.push_front(LineSegment::new([0.0, 0.0], [1.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 1);
// The stop point of this segment matches the start point of the already
// inserted segment
chain.push_front(LineSegment::new([0.0, 1.0], [0.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 2);
// Start and stop point don't match -> A filler segment is introduced
chain.push_front(LineSegment::new([2.0, 1.0], [2.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 4);Sourcepub fn pop_back(&mut self) -> Option<Segment>
pub fn pop_back(&mut self) -> Option<Segment>
Removes the last / back element from the chain and returns it, or None
if it is empty.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
let ls: Segment = LineSegment::new([0.0, 0.0], [1.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
chain.push_back(ls.clone());
assert_eq!(chain.len(), 1);
assert_eq!(chain.pop_back(), Some(ls));
assert_eq!(chain.pop_back(), None);
Sourcepub fn pop_front(&mut self) -> Option<Segment>
pub fn pop_front(&mut self) -> Option<Segment>
Removes the first / front element from the chain and returns it, or None
if it is empty.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
let ls: Segment = LineSegment::new([0.0, 0.0], [1.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
chain.push_front(ls.clone());
assert_eq!(chain.len(), 1);
assert_eq!(chain.pop_front(), Some(ls));
assert_eq!(chain.pop_front(), None);
Sourcepub fn back(&self) -> Option<&Segment>
pub fn back(&self) -> Option<&Segment>
Provides a reference to the back element, or None if the chain is empty.
§Examples
use planar_geo::prelude::*;
let chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]);
let ls: Segment = LineSegment::new([1.0, 0.0], [0.0, 1.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
assert_eq!(chain.back(), Some(&ls));Sourcepub fn front(&self) -> Option<&Segment>
pub fn front(&self) -> Option<&Segment>
Provides a reference to the front element, or None if the chain is empty.
§Examples
use planar_geo::prelude::*;
let chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]);
let ls: Segment = LineSegment::new([0.0, 0.0], [1.0, 0.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
assert_eq!(chain.front(), Some(&ls));
Sourcepub fn extend_back(&mut self, point: [f64; 2])
pub fn extend_back(&mut self, point: [f64; 2])
Adds a LineSegment to the front of self which stops at point and
starts at the current stop point of self - i.e., the stop point of the
Segment returned from SegmentChain::back. If self is empty or
point is equal to stop, this is a no-op.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
assert_eq!(chain.len(), 0);
// No-op, since the chain is empty
chain.extend_back([0.0, 0.0]);
assert_eq!(chain.len(), 0);
// Now add a line
chain.push_back(LineSegment::new([1.0, 0.0], [1.0, 1.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 1);
// Now adding the point works
chain.extend_back([0.0, 0.0]);
assert_eq!(chain.len(), 2);Sourcepub fn extend_front(&mut self, point: [f64; 2])
pub fn extend_front(&mut self, point: [f64; 2])
Adds a LineSegment to the front of self which starts at point and
stops at the current start point of self - i.e., the start point of the
Segment returned from SegmentChain::front. If self is empty or
point is equal to start, this is a no-op.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::new();
assert_eq!(chain.len(), 0);
// No-op, since the chain is empty
chain.extend_front([0.0, 0.0]);
assert_eq!(chain.len(), 0);
// Now add a line
chain.push_front(LineSegment::new([1.0, 0.0], [1.0, 1.0], DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into());
assert_eq!(chain.len(), 1);
// Now adding the point works
chain.extend_front([0.0, 0.0]);
assert_eq!(chain.len(), 2);Sourcepub fn iter(&self) -> Iter<'_, Segment>
pub fn iter(&self) -> Iter<'_, Segment>
Returns a front-to-back iterator over all Segments of self.
§Examples
use planar_geo::prelude::*;
let chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]);
let mut iter = chain.iter();
assert!(iter.next().is_some());
assert!(iter.next().is_some());
assert!(iter.next().is_none());Sourcepub fn append(&mut self, other: &mut SegmentChain)
pub fn append(&mut self, other: &mut SegmentChain)
Moves all Segments of other into self, leaving other empty.
If the first point of other is not equal to the last point of self, a
filler line segment is introduced first
§Panics
Panics if the new number of elements in self overflows an usize.
§Examples
use planar_geo::prelude::*;
let mut chain1 = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]);
let mut chain2 = SegmentChain::from_points(&[[1.0, 1.0], [0.0, 1.0]]);
let mut chain3 = SegmentChain::from_points(&[[0.0, 2.0], [0.0, 3.0]]);
assert_eq!(chain1.len(), 2);
assert_eq!(chain2.len(), 1);
assert_eq!(chain3.len(), 1);
chain1.append(&mut chain2);
assert_eq!(chain1.len(), 3);
chain1.append(&mut chain3);
assert_eq!(chain1.len(), 5);Sourcepub fn points(&self) -> PointIterator<'_> ⓘ
pub fn points(&self) -> PointIterator<'_> ⓘ
Returns an iterator over all points of the chain.
§Examples
use planar_geo::prelude::*;
let chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]);
let mut iter = chain.points();
assert_eq!(iter.next(), Some([0.0, 0.0]));
assert_eq!(iter.next(), Some([1.0, 0.0]));
assert_eq!(iter.next(), Some([1.0, 1.0]));
assert_eq!(iter.next(), None);Sourcepub fn polygonize(&self, polygonizer: Polygonizer) -> PointIterator<'_> ⓘ
pub fn polygonize(&self, polygonizer: Polygonizer) -> PointIterator<'_> ⓘ
Returns the points of a polygon chain which approximates self. The
individual segments are “polygonized” via Segment::polygonize and
an [SegmentPolygonizer] specified within Polygonizer. See the
docstring of the latter fore more.
Sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
Returns the combined length of all segments of self.
use planar_geo::prelude::*;
use std::f64::consts::{PI, TAU, SQRT_2};
// Square with a side length of 1
let points = &[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]];
let mut segment_chain = SegmentChain::from_points(points);
segment_chain.close();
assert_eq!(segment_chain.length(), 4.0);
// Circle with a radius of 1
let segment: Segment = ArcSegment::from_center_radius_start_offset_angle([0.0, 0.0], 1.0, 0.0, TAU, DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
let segment_chain = SegmentChain::from(segment);
assert_eq!(segment_chain.length(), TAU);
// Half-circle segment
let segment: Segment = ArcSegment::from_center_radius_start_offset_angle([0.0, 0.0], 1.0, 0.0, PI, DEFAULT_EPSILON, DEFAULT_MAX_ULPS).unwrap().into();
let mut segment_chain = SegmentChain::from(segment);
segment_chain.close();
assert_eq!(segment_chain.length(), PI + 2.0);
// Triangle
let points = &[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]];
let mut segment_chain = SegmentChain::from_points(points);
segment_chain.close();
assert_eq!(segment_chain.length(), 2.0 + SQRT_2);Sourcepub fn intersection_cut(
&self,
other: &SegmentChain,
epsilon: f64,
max_ulps: u32,
) -> Vec<SegmentChain>
pub fn intersection_cut( &self, other: &SegmentChain, epsilon: f64, max_ulps: u32, ) -> Vec<SegmentChain>
Cuts self into multiple chains by intersecting it with other and returns
those them.
The specified tolerances epsilon and max_ulps are used to determine
intersections, see documentation of
PrimitiveIntersections.
§Examples
use planar_geo::prelude::*;
let points = &[[0.0, 0.0], [2.0, 0.0], [2.0, 2.0], [0.0, 2.0]];
let line = SegmentChain::from_points(points);
let cut = SegmentChain::from_points(&[[-1.0, 1.0], [3.0, 1.0]]);
let separated_lines = line.intersection_cut(&cut, DEFAULT_EPSILON, DEFAULT_MAX_ULPS);
// This cut results in two separate chains
assert_eq!(separated_lines.len(), 2);Sourcepub fn reverse(&mut self)
pub fn reverse(&mut self)
Reverses all Segments of the chain by switching their start and stop
points (see Segment::reverse). To ensure the “connected” property holds
true, the ordering of the segments itself is exchanged as well.
This method calls make_contiguous so all
segments are in the first slice before reversing it.
§Examples
use planar_geo::prelude::*;
let mut chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]);
assert_eq!(chain.front().unwrap().start(), [0.0, 0.0]);
assert_eq!(chain.back().unwrap().stop(), [0.0, 1.0]);
chain.reverse();
assert_eq!(chain.front().unwrap().start(), [0.0, 1.0]);
assert_eq!(chain.back().unwrap().stop(), [0.0, 0.0]);Sourcepub fn rotational_pattern(
&mut self,
center: [f64; 2],
angle: f64,
repetitions: usize,
)
pub fn rotational_pattern( &mut self, center: [f64; 2], angle: f64, repetitions: usize, )
Creates a rotated pattern from self. For each one of the specified
repetitions, the individual segments of self are cloned, rotated around
center and then pushed to the back of self. The rotation angle is
angle times the index of the current repetition plus one.
§Examples
use planar_geo::prelude::*;
use std::f64::consts::FRAC_PI_2;
let mut chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0]]);
// 0 repetitions => The original chain is left unchanged
chain.rotational_pattern([1.0, 1.0], FRAC_PI_2, 0);
let points: Vec<[f64; 2]> = chain.points().collect();
assert_eq!(points.len(), 2);
approx::assert_abs_diff_eq!(points[0], [0.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[1], [1.0, 0.0], epsilon = 1e-10);
// Two repetitions: The points are rotated by 90° and 180° respectively.
// The chain has 6 points after the extension
chain.rotational_pattern([1.0, 1.0], FRAC_PI_2, 2);
let points: Vec<[f64; 2]> = chain.points().collect();
assert_eq!(points.len(), 6);
approx::assert_abs_diff_eq!(points[0], [0.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[1], [1.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[2], [2.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[3], [2.0, 1.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[4], [2.0, 2.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[5], [1.0, 2.0], epsilon = 1e-10);Sourcepub fn translational_pattern(&mut self, shift: [f64; 2], repetitions: usize)
pub fn translational_pattern(&mut self, shift: [f64; 2], repetitions: usize)
Creates a translated pattern from self. For each one of the specified
repetitions, the individual segments of self are cloned, shifted and
then pushed to the back of self. The shift vector is shift times the
index of the current repetition plus one.
§Examples
use planar_geo::prelude::*;
use std::f64::consts::FRAC_PI_2;
let mut chain = SegmentChain::from_points(&[[0.0, 0.0], [1.0, 0.0]]);
// 0 repetitions => The original chain is left unchanged
chain.translational_pattern([1.0, 1.0], 0);
let points: Vec<[f64; 2]> = chain.points().collect();
assert_eq!(points.len(), 2);
approx::assert_abs_diff_eq!(points[0], [0.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[1], [1.0, 0.0], epsilon = 1e-10);
// Two repetitions: A "stair" segment chain is created
chain.translational_pattern([1.0, 1.0], 2);
let points: Vec<[f64; 2]> = chain.points().collect();
assert_eq!(points.len(), 6);
approx::assert_abs_diff_eq!(points[0], [0.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[1], [1.0, 0.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[2], [1.0, 1.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[3], [2.0, 1.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[4], [2.0, 2.0], epsilon = 1e-10);
approx::assert_abs_diff_eq!(points[5], [3.0, 2.0], epsilon = 1e-10);Source§impl SegmentChain
impl SegmentChain
Sourcepub fn draw(&self, style: &Style, context: &Context) -> Result<(), Error>
pub fn draw(&self, style: &Style, context: &Context) -> Result<(), Error>
Draws the SegmentChain onto the cairo::Context with the given Style.
See the module level documentation.
Trait Implementations§
Source§impl Clone for SegmentChain
impl Clone for SegmentChain
Source§fn clone(&self) -> SegmentChain
fn clone(&self) -> SegmentChain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Composite for SegmentChain
impl Composite for SegmentChain
Source§type SegmentKey = SegmentIdx
type SegmentKey = SegmentIdx
Self via
Composite::segment. This type is the “left” part of the Intersection
returned by the various intersection methods of the Composite trait and
can be used to directly retrieve the segment where the intersection occurred.Source§fn segment(&self, key: Self::SegmentKey) -> Option<&Segment>
fn segment(&self, key: Self::SegmentKey) -> Option<&Segment>
key, if it exists. Read moreSource§fn num_segments(&self) -> usize
fn num_segments(&self) -> usize
Source§fn centroid(&self) -> [f64; 2]
fn centroid(&self) -> [f64; 2]
self, i.e. its center of mass. Read moreSource§fn intersections_primitive<'a, T: Primitive + Sync>(
&'a self,
primitive: &'a T,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, ()>> + 'a
fn intersections_primitive<'a, T: Primitive + Sync>( &'a self, primitive: &'a T, epsilon: f64, max_ulps: u32, ) -> impl Iterator<Item = Intersection<Self::SegmentKey, ()>> + 'a
Source§fn intersections_primitive_par<'a, T: Primitive + Sync>(
&'a self,
primitive: &'a T,
epsilon: f64,
max_ulps: u32,
) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, ()>> + 'a
fn intersections_primitive_par<'a, T: Primitive + Sync>( &'a self, primitive: &'a T, epsilon: f64, max_ulps: u32, ) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, ()>> + 'a
Source§fn intersections_segment_chain<'a>(
&'a self,
other: &'a Self,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
fn intersections_segment_chain<'a>( &'a self, other: &'a Self, epsilon: f64, max_ulps: u32, ) -> impl Iterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
Source§fn intersections_segment_chain_par<'a>(
&'a self,
other: &'a Self,
epsilon: f64,
max_ulps: u32,
) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
fn intersections_segment_chain_par<'a>( &'a self, other: &'a Self, epsilon: f64, max_ulps: u32, ) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
Source§fn intersections_contour<'a>(
&'a self,
contour: &'a Contour,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, SegmentIdx>>
fn intersections_contour<'a>( &'a self, contour: &'a Contour, epsilon: f64, max_ulps: u32, ) -> impl Iterator<Item = Intersection<Self::SegmentKey, SegmentIdx>>
Source§fn intersections_contour_par<'a>(
&'a self,
contour: &'a Contour,
epsilon: f64,
max_ulps: u32,
) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
fn intersections_contour_par<'a>( &'a self, contour: &'a Contour, epsilon: f64, max_ulps: u32, ) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, SegmentIdx>> + 'a
Source§fn intersections_shape<'a>(
&'a self,
shape: &'a Shape,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, ShapeIdx>>
fn intersections_shape<'a>( &'a self, shape: &'a Shape, epsilon: f64, max_ulps: u32, ) -> impl Iterator<Item = Intersection<Self::SegmentKey, ShapeIdx>>
Source§fn intersections_shape_par<'a>(
&'a self,
shape: &'a Shape,
epsilon: f64,
max_ulps: u32,
) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, ShapeIdx>>
fn intersections_shape_par<'a>( &'a self, shape: &'a Shape, epsilon: f64, max_ulps: u32, ) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, ShapeIdx>>
Source§fn intersections_composite<'a, T: Composite>(
&'a self,
other: &'a T,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, T::SegmentKey>> + 'awhere
Self: Sized,
fn intersections_composite<'a, T: Composite>(
&'a self,
other: &'a T,
epsilon: f64,
max_ulps: u32,
) -> impl Iterator<Item = Intersection<Self::SegmentKey, T::SegmentKey>> + 'awhere
Self: Sized,
Source§fn intersections_composite_par<'a, T: Composite>(
&'a self,
other: &'a T,
epsilon: f64,
max_ulps: u32,
) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, T::SegmentKey>> + 'a
fn intersections_composite_par<'a, T: Composite>( &'a self, other: &'a T, epsilon: f64, max_ulps: u32, ) -> impl ParallelIterator<Item = Intersection<Self::SegmentKey, T::SegmentKey>> + 'a
Source§impl Debug for SegmentChain
impl Debug for SegmentChain
Source§impl<'de> Deserialize<'de> for SegmentChain
impl<'de> Deserialize<'de> for SegmentChain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&BoundingBox> for SegmentChain
impl From<&BoundingBox> for SegmentChain
Source§fn from(bounding_box: &BoundingBox) -> Self
fn from(bounding_box: &BoundingBox) -> Self
Source§impl From<&SegmentChain> for BoundingBox
impl From<&SegmentChain> for BoundingBox
Source§fn from(value: &SegmentChain) -> BoundingBox
fn from(value: &SegmentChain) -> BoundingBox
Source§impl From<ArcSegment> for SegmentChain
impl From<ArcSegment> for SegmentChain
Source§fn from(value: ArcSegment) -> Self
fn from(value: ArcSegment) -> Self
Source§impl From<BoundingBox> for SegmentChain
impl From<BoundingBox> for SegmentChain
Source§fn from(bounding_box: BoundingBox) -> Self
fn from(bounding_box: BoundingBox) -> Self
Source§impl From<Contour> for SegmentChain
impl From<Contour> for SegmentChain
Source§impl From<LineSegment> for SegmentChain
impl From<LineSegment> for SegmentChain
Source§fn from(value: LineSegment) -> Self
fn from(value: LineSegment) -> Self
Source§impl From<Segment> for SegmentChain
impl From<Segment> for SegmentChain
Source§impl From<SegmentChain> for Contour
impl From<SegmentChain> for Contour
Source§fn from(segment_chain: SegmentChain) -> Self
fn from(segment_chain: SegmentChain) -> Self
Source§impl From<SegmentChain> for VecDeque<Segment>
impl From<SegmentChain> for VecDeque<Segment>
Source§fn from(line: SegmentChain) -> Self
fn from(line: SegmentChain) -> Self
Source§impl FromIterator<Segment> for SegmentChain
impl FromIterator<Segment> for SegmentChain
Source§impl Index<usize> for SegmentChain
impl Index<usize> for SegmentChain
Source§impl IntoIterator for SegmentChain
impl IntoIterator for SegmentChain
Source§impl PartialEq for SegmentChain
impl PartialEq for SegmentChain
Source§impl Serialize for SegmentChain
impl Serialize for SegmentChain
Source§impl Transformation for SegmentChain
impl Transformation for SegmentChain
impl StructuralPartialEq for SegmentChain
Auto Trait Implementations§
impl Freeze for SegmentChain
impl RefUnwindSafe for SegmentChain
impl Send for SegmentChain
impl Sync for SegmentChain
impl Unpin for SegmentChain
impl UnsafeUnpin for SegmentChain
impl UnwindSafe for SegmentChain
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
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>
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>
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 more