# [−][src]Struct outline_2d::Outline

`pub struct Outline { /* fields omitted */ }`

Represent closed circuit of vertices

## Methods

### `impl Outline`[src]

#### `pub fn new(vertices: impl Iterator<Item = Vec2>) -> Self`[src]

Creates new outline.

# Arguments

• `vertices` - iterator of vertices. They MUST follow in order, which guarantee:
1. when follow from i to i+1 vertex, inner area of polygon MUST be at left side;

#### `pub fn prev_that_next(&self, i: isize) -> (Vec2, Vec2, Vec2)`[src]

Tuple of (`i-1`, `i`, `i+1`) vertices;

• `i` - index of vertex. May be negative;

#### `pub fn to_neighbors(&self, i: isize) -> (Vec2, Vec2)`[src]

Tuple of vectors to previous and to next vertex for `i`-th vertex;

• `i` - index of vertex. May be negative;

#### `pub fn convex(&self, i: isize) -> bool`[src]

Test if angle is convex;

• `i` - index of vertex. May be negative;

#### `pub fn concave(&self, i: isize) -> bool`[src]

Test if angle is concave;

• `i` - index of vertex. May be negative;

#### `pub fn inner_angle_cos_sin(&self, i: isize) -> (f32, f32)`[src]

`sin()` and `cos()` for counter-clockwise angle between vector to next vertex and vector to previous.

# Arguments

• `i` - index of vertex. May be negative;

#### `pub fn inner_angle(&self, i: isize) -> f32`[src]

Inner angle for vertex `i`-th vertex

# Arguments

• `i` - index of vertex. May be negative;

#### `pub fn outer_angle(&self, i: isize) -> f32`[src]

Outer angle for vertex `i`-th vertex

# Arguments

• `i` - index of vertex. May be negative;

## Trait Implementations

### `impl Index<isize> for Outline`[src]

#### `type Output = Vec2`

The returned type after indexing.

## Blanket Implementations

### `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.