pub struct Loop<'a, T: CLIType> { /* private fields */ }
Expand description
Object representing a loop inside of a Layer
Each Loop
contains an id (see the spec for uses), a direction and a slice pointer to the geometry data.
According to the spec, the direction could be one of 3 values. However, it is left as an integer since some slicers interpret these values differently. According to the spec the direction can be:
- 0 : clockwise (internal)
- 1 : counter-clockwise (external)
- 2 : open line (no solid)
Each point is stored as an array of length two of the CLIType
’s associated Coord type.
The Point
trait is provided as a more elegant way to access the data.
Implementations
pub fn iter(&'a self) -> ArrayChunksCopy<'a, <T as CLIType>::Coord, 2>ⓘNotable traits for ArrayChunksCopy<'a, T, N>impl<'a, T: Copy, const N: usize> Iterator for ArrayChunksCopy<'a, T, N> type Item = [T; N];
pub fn iter(&'a self) -> ArrayChunksCopy<'a, <T as CLIType>::Coord, 2>ⓘNotable traits for ArrayChunksCopy<'a, T, N>impl<'a, T: Copy, const N: usize> Iterator for ArrayChunksCopy<'a, T, N> type Item = [T; N];
Notable traits for ArrayChunksCopy<'a, T, N>
impl<'a, T: Copy, const N: usize> Iterator for ArrayChunksCopy<'a, T, N> type Item = [T; N];
Iterate over each point in the loop as [T; 2]
Note availability of Point
trait for a cleaner interface
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Loop<'a, T> where
<T as CLIType>::Coord: RefUnwindSafe,
<T as CLIType>::Meta: RefUnwindSafe,
impl<'a, T> UnwindSafe for Loop<'a, T> where
<T as CLIType>::Coord: RefUnwindSafe,
<T as CLIType>::Meta: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more