Struct colain::Loop[][src]

pub struct Loop<'a, T: CLIType> { /* fields omitted */ }

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

impl<'a, T: CLIType> Loop<'a, T>[src]

pub fn iter(&'a self) -> ArrayChunksCopy<'a, <T as CLIType>::Coord, 2>[src]

Iterate over each point in the loop as [T; 2]

Note availability of Point trait for a cleaner interface

pub fn id(&self) -> <T as CLIType>::Meta[src]

Get the CLI ID of this primitive

pub fn dir(&self) -> <T as CLIType>::Meta[src]

Get the direction of this loop

pub fn points(&'a self) -> &'a [<T as CLIType>::Coord][src]

Pointer into the segment of the file that contains this geometry

Trait Implementations

impl<'a, T: Clone + CLIType> Clone for Loop<'a, T>[src]

impl<'a, T: Debug + CLIType> Debug for Loop<'a, T>[src]

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> Send for Loop<'a, T> where
    <T as CLIType>::Coord: Sync,
    <T as CLIType>::Meta: Send

impl<'a, T> Sync for Loop<'a, T> where
    <T as CLIType>::Coord: Sync,
    <T as CLIType>::Meta: Sync

impl<'a, T> Unpin for Loop<'a, T> where
    <T as CLIType>::Meta: Unpin

impl<'a, T> UnwindSafe for Loop<'a, T> where
    <T as CLIType>::Coord: RefUnwindSafe,
    <T as CLIType>::Meta: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.