[][src]Trait plexus::IteratorExt

pub trait IteratorExt: Iterator + Sized {
    fn perimeter(self) -> Perimeter<Self>
        Self::Item: Clone
, { ... }
fn keys(self) -> Keys<Self>
        Self::Item: ClosedView
, { ... } }

Extension methods for types implementing Iterator.

Provided methods

Important traits for Perimeter<I>
fn perimeter(self) -> Perimeter<Self> where
    Self::Item: Clone

Provides an iterator over a window of duplets that includes the first value in the sequence at the beginning and end of the iteration.

Given a collection of ordered elements $\{a, b, c\}$, this iterator yeilds the ordered items $\{(a, b), (b, c), (c, a)\}$.

Important traits for Keys<I>
fn keys(self) -> Keys<Self> where
    Self::Item: ClosedView

Maps an iterator over topological views to the keys of those views.

It is often useful to examine or collect the keys of views over a MeshGraph. This iterator avoids redundant use of map to extract keys.


Collecting keys of faces before a topological mutation:

use decorum::R64;
use nalgebra::Point3;
use plexus::graph::MeshGraph;
use plexus::prelude::*;
use plexus::primitive::generate::Position;
use plexus::primitive::sphere::UvSphere;

type E3 = Point3<R64>;

let mut graph = UvSphere::new(6, 6)

let keys = graph
    .filter(|face| face.arity() > 3)
for key in keys {
Loading content...


impl<I> IteratorExt for I where
    I: Iterator

Loading content...