[−][src]Struct outline_2d::Outline
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:
- 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]
pub fn outer_angle(&self, i: isize) -> f32
[src]
Trait Implementations
impl Clone for Outline
[src]
impl Debug for Outline
[src]
impl Default for Outline
[src]
impl Index<isize> for Outline
[src]
Auto Trait Implementations
impl RefUnwindSafe for Outline
impl Send for Outline
impl Sync for Outline
impl Unpin for Outline
impl UnwindSafe for Outline
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,