Struct colain::Loop

source · []
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

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

Note availability of Point trait for a cleaner interface

Get the CLI ID of this primitive

Get the direction of this loop

Pointer into the segment of the file that contains this geometry

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.