pub trait HasIterators: HasTopology {
Show 52 methods
// Provided methods
fn voh_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH> { ... }
fn voh_cw_iter(&self, v: VH) -> impl Iterator<Item = HH> { ... }
fn vih_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH> { ... }
fn vih_cw_iter(&self, v: VH) -> impl Iterator<Item = HH> { ... }
fn vf_ccw_iter(&self, v: VH) -> impl Iterator<Item = FH> { ... }
fn vf_cw_iter(&self, v: VH) -> impl Iterator<Item = FH> { ... }
fn vv_ccw_iter(&self, v: VH) -> impl Iterator<Item = VH> { ... }
fn vv_cw_iter(&self, v: VH) -> impl Iterator<Item = VH> { ... }
fn ve_ccw_iter(&self, v: VH) -> impl Iterator<Item = EH> { ... }
fn ve_cw_iter(&self, v: VH) -> impl Iterator<Item = EH> { ... }
fn ev_iter(&self, e: EH) -> impl Iterator<Item = VH> { ... }
fn eh_iter(&self, e: EH) -> impl Iterator<Item = HH> { ... }
fn ef_iter(&self, e: EH) -> impl Iterator<Item = FH> { ... }
fn fh_ccw_iter(&self, f: FH) -> impl Iterator<Item = HH> { ... }
fn fh_cw_iter(&self, f: FH) -> impl Iterator<Item = HH> { ... }
fn fv_ccw_iter(&self, f: FH) -> impl Iterator<Item = VH> { ... }
fn fv_cw_iter(&self, f: FH) -> impl Iterator<Item = VH> { ... }
fn fe_ccw_iter(&self, f: FH) -> impl Iterator<Item = EH> { ... }
fn fe_cw_iter(&self, f: FH) -> impl Iterator<Item = EH> { ... }
fn ff_ccw_iter(&self, f: FH) -> impl Iterator<Item = FH> { ... }
fn ff_cw_iter(&self, f: FH) -> impl Iterator<Item = FH> { ... }
fn ccw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH> { ... }
fn cw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH> { ... }
fn loop_ccw_iter(&self, h: HH) -> impl Iterator<Item = HH> { ... }
fn loop_cw_iter(&self, h: HH) -> impl Iterator<Item = HH> { ... }
fn voh_ccw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn voh_cw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn vih_ccw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn vih_cw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn vv_ccw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, VH)> { ... }
fn vv_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, VH)> { ... }
fn ve_ccw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, EH)> { ... }
fn ve_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, EH)> { ... }
fn vf_ccw_iter_mut(
&mut self,
v: VH,
) -> impl Iterator<Item = (&mut Self, FH)> { ... }
fn vf_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, FH)> { ... }
fn fv_ccw_iter_mut(
&mut self,
f: FH,
) -> impl Iterator<Item = (&mut Self, VH)> { ... }
fn fv_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, VH)> { ... }
fn fh_ccw_iter_mut(
&mut self,
f: FH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn fh_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn fe_ccw_iter_mut(
&mut self,
f: FH,
) -> impl Iterator<Item = (&mut Self, EH)> { ... }
fn fe_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, EH)> { ... }
fn ff_ccw_iter_mut(
&mut self,
f: FH,
) -> impl Iterator<Item = (&mut Self, FH)> { ... }
fn ff_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, FH)> { ... }
fn ccw_rotate_iter_mut(
&mut self,
h: HH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn cw_rotate_iter_mut(
&mut self,
h: HH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn loop_ccw_iter_mut(
&mut self,
h: HH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn loop_cw_iter_mut(
&mut self,
h: HH,
) -> impl Iterator<Item = (&mut Self, HH)> { ... }
fn triangulated_face_vertices(&self, f: FH) -> impl Iterator<Item = [VH; 3]> { ... }
fn triangulated_loop_vertices(
&self,
hstart: HH,
) -> impl Iterator<Item = [VH; 3]> { ... }
fn triangulated_vertices(
&self,
fstatus: &FPropBuf<Status>,
) -> impl Iterator<Item = [VH; 3]> { ... }
fn find_halfedge(&self, from: VH, to: VH) -> Option<HH> { ... }
fn adjust_outgoing_halfedge(&mut self, v: VH) { ... }
}Expand description
This trait defines iterators to traverse the topology of a mesh.
§Working with mutable iterators
Iterators such as Self::loop_ccw_iter and other *_iter iterators
borrow the mesh immutably. These are useful when iterating over the elements
of the mesh without needing to modify the mesh. While the mesh is borrowed
by the iterators, the borrow checker will not let you borrow the mesh again
mutably, for as long as the iterator is alive. This is a problem if you’re
trying to modify the mesh while iterating over it’s elements. In such
scenarios, mutable iterators are useful. These functions end with
*_iter_mut.
The *_iter_mut functions borrow the mesh mutably. Similar to immutable
iterators, while the mutable iterator is alive, the borrow checker won’t let
you mutably borrow the mesh again. But, unlike the immutable iterators, the
mutable iterators don’t yield just the elements of the mesh. Instead the
mutable iterators yield a tuple containing a mutable reference to the mesh,
and the mesh element. You can modify the mesh using the mutable reference
yielded by the mutable iterator. So essentially, the borrow checker is happy
because the iterator borrows the mesh mutably and to modify the mesh, you
borrow the mesh from the iterator. The borrows are chained instead of being
simultaenous. This keeps the borrow checker happy, and ensures safety to
some extent. Below is some example code that iterates over the vertices of
face with index 2, and modifies their positions.
use alum::{PolyMeshF32, FH, HasIterators, HasTopology};
let mut boxmesh = PolyMeshF32::unit_box().expect("Cannot create a box");
assert_eq!(1.0, boxmesh.try_calc_volume().expect("Cannot compute volume"));
// Modify the mesh while using a mutable iterator - pull points closer to origin.
let f: FH = 2.into();
for (mesh, v) in boxmesh.fv_ccw_iter_mut(f) {
// Inside this loop, while the iterator is alive, we cannot borrow `boxmesh`
// because the iterator already borrowed `boxmesh` mutably. Instead we will use
// the `mesh` mutable reference yielded by the iterator along with the halfedge.
let mut pos = mesh.point(v).expect("Cannot read position");
pos *= 0.75;
mesh.set_point(v, pos);
}
// The iterator is not alive anymore, so we can borrow `boxmesh` again.
boxmesh.check_topology().expect("Topological errors found");
// Volume is smaller than one because we pulled the vertices closer to the origin.
assert!(1.0 > boxmesh.try_calc_volume().expect("Cannot compute volume"));Despite enforcing the borrow checker rules, the mutable iterators can lead to problems when used incorrectly. Modifying the topology of the mesh while using mutable iterators is NOT advised, as this can lead to topological errors. Only do this if you’re know what you’re doing. This is akin to mutably iterating over a linked list while modifying the links between the elements of the linked list. You can easily create cycles, infinite loops and other problems if you’re not careful.
Provided Methods§
Sourcefn voh_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH>
fn voh_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH>
Iterator over the outgoing halfedges around a vertex, going counter-clockwise.
Sourcefn voh_cw_iter(&self, v: VH) -> impl Iterator<Item = HH>
fn voh_cw_iter(&self, v: VH) -> impl Iterator<Item = HH>
Iterator over the outgoing halfedges around a vertex, going clockwise
Sourcefn vih_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH>
fn vih_ccw_iter(&self, v: VH) -> impl Iterator<Item = HH>
Iterator over the incoming halfedges around a vertex, going counter-clockwise
Sourcefn vih_cw_iter(&self, v: VH) -> impl Iterator<Item = HH>
fn vih_cw_iter(&self, v: VH) -> impl Iterator<Item = HH>
Iterator over the incoming halfedges around a vertex, going clockwise
Sourcefn vf_ccw_iter(&self, v: VH) -> impl Iterator<Item = FH>
fn vf_ccw_iter(&self, v: VH) -> impl Iterator<Item = FH>
Iterator over the faces incident on a vertex, going counter-clockwise.
Sourcefn vf_cw_iter(&self, v: VH) -> impl Iterator<Item = FH>
fn vf_cw_iter(&self, v: VH) -> impl Iterator<Item = FH>
Iterator over the faces incident on a vertex, going clockwise.
Sourcefn vv_ccw_iter(&self, v: VH) -> impl Iterator<Item = VH>
fn vv_ccw_iter(&self, v: VH) -> impl Iterator<Item = VH>
Iterator over the neighboring vertices around the given vertex, going counter-clockwise.
Sourcefn vv_cw_iter(&self, v: VH) -> impl Iterator<Item = VH>
fn vv_cw_iter(&self, v: VH) -> impl Iterator<Item = VH>
Iterator over the neighboring vertices around the given vertex, going clockwise.
Sourcefn ve_ccw_iter(&self, v: VH) -> impl Iterator<Item = EH>
fn ve_ccw_iter(&self, v: VH) -> impl Iterator<Item = EH>
Iterator over the incident edges around an vertex, going counter-clockwise.
Sourcefn ve_cw_iter(&self, v: VH) -> impl Iterator<Item = EH>
fn ve_cw_iter(&self, v: VH) -> impl Iterator<Item = EH>
Iterator over the incident edges around a vertex, going clockwise.
Sourcefn ev_iter(&self, e: EH) -> impl Iterator<Item = VH>
fn ev_iter(&self, e: EH) -> impl Iterator<Item = VH>
Iterator over the two vertices incident on the given edge.
Sourcefn eh_iter(&self, e: EH) -> impl Iterator<Item = HH>
fn eh_iter(&self, e: EH) -> impl Iterator<Item = HH>
Iterator over the two halfedges corresponding to an edge.
Sourcefn ef_iter(&self, e: EH) -> impl Iterator<Item = FH>
fn ef_iter(&self, e: EH) -> impl Iterator<Item = FH>
Iterator over the faces incident on an edge.
Sourcefn fh_ccw_iter(&self, f: FH) -> impl Iterator<Item = HH>
fn fh_ccw_iter(&self, f: FH) -> impl Iterator<Item = HH>
Iterator over the halfedges of a face loop, going counter-clockwise.
Sourcefn fh_cw_iter(&self, f: FH) -> impl Iterator<Item = HH>
fn fh_cw_iter(&self, f: FH) -> impl Iterator<Item = HH>
Iterator over the halfedges of a face loop, going clockwise.
Sourcefn fv_ccw_iter(&self, f: FH) -> impl Iterator<Item = VH>
fn fv_ccw_iter(&self, f: FH) -> impl Iterator<Item = VH>
Iterator over the vertices incident on a face, going counter-clockwise.
Sourcefn fv_cw_iter(&self, f: FH) -> impl Iterator<Item = VH>
fn fv_cw_iter(&self, f: FH) -> impl Iterator<Item = VH>
Iterator over the vertices incident on a face, going clockwise.
Sourcefn fe_ccw_iter(&self, f: FH) -> impl Iterator<Item = EH>
fn fe_ccw_iter(&self, f: FH) -> impl Iterator<Item = EH>
Iterator over the edges incident on a face, going counter-clockwise.
Sourcefn fe_cw_iter(&self, f: FH) -> impl Iterator<Item = EH>
fn fe_cw_iter(&self, f: FH) -> impl Iterator<Item = EH>
Iterator over the edges incident on a face, going clockwise.
Sourcefn ff_ccw_iter(&self, f: FH) -> impl Iterator<Item = FH>
fn ff_ccw_iter(&self, f: FH) -> impl Iterator<Item = FH>
Iterator over the neighboring faces arouund the given face, going counter-clockwise.
This includes the faces connected via a shared edge, but not those connected via a shared vertex.
Sourcefn ff_cw_iter(&self, f: FH) -> impl Iterator<Item = FH>
fn ff_cw_iter(&self, f: FH) -> impl Iterator<Item = FH>
Iterator over the neighboring faces around the given face, going clockwise.
This includes the faces connected via a shared edge, but not those connected via a shared vertex.
Sourcefn ccw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH>
fn ccw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH>
This is similar to Self::voh_ccw_iter around the tail of the given
halfedge, except this iterator starts at the provided halfedge.
This is equivalent to a circular shifted Self::voh_ccw_iter of the
vertex at the tail of this halfedge.
Sourcefn cw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH>
fn cw_rotate_iter(&self, h: HH) -> impl Iterator<Item = HH>
This is similar to Self::voh_cw_iter around the tail of the given
halfedge, except this iterator starts at the provided halfedge.
This is equivalent to a circular shifted Self::voh_cw_iter of the
vertex at the tail of this halfedge.
Sourcefn loop_ccw_iter(&self, h: HH) -> impl Iterator<Item = HH>
fn loop_ccw_iter(&self, h: HH) -> impl Iterator<Item = HH>
Counter-clockwise iterator over the halfedges in a loop.
The iterator will start at the given halfedge. If the halfedge has an
incident face, this iterator is equivalent to a circular shifted
Self::fh_ccw_iter of the incident face. If the halfedge is on the
boundary, this iterator goes over the boundary loop counter-clockwise.
Sourcefn loop_cw_iter(&self, h: HH) -> impl Iterator<Item = HH>
fn loop_cw_iter(&self, h: HH) -> impl Iterator<Item = HH>
Counter-clockwise iterator over the halfedges in a loop.
The iterator will start at the given halfedge. If the halfedge has an
incident face, this iterator is equivalent to a circular shifted
Self::fh_cw_iter of the incident face. If the halfedge is on the
boundary, this iterator goes over the boundary loop clockwise.
Sourcefn voh_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
fn voh_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the outgoing halfedges around a vertex, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn voh_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
fn voh_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the outgoing halfedges around a vertex, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vih_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
fn vih_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the incoming halfedges around a vertex, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vih_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
fn vih_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the incoming halfedges around a vertex, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vv_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, VH)>
fn vv_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, VH)>
Mutable iterator over the neighboring vertices around the given vertex, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vv_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, VH)>
fn vv_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, VH)>
Mutable iterator over the neighboring vertices around the given vertex, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn ve_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, EH)>
fn ve_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, EH)>
Iterator over the incident edges around a vertex, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn ve_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, EH)>
fn ve_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, EH)>
Iterator over the incident edges around a vertex, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vf_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, FH)>
fn vf_ccw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, FH)>
Iterator over the incident faces around a vertex, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn vf_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, FH)>
fn vf_cw_iter_mut(&mut self, v: VH) -> impl Iterator<Item = (&mut Self, FH)>
Iterator over the incident faces around a vertex, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fv_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, VH)>
fn fv_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, VH)>
Iterator over the vertices incident on a face, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fv_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, VH)>
fn fv_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, VH)>
Iterator over the vertices incident on a face, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fh_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, HH)>
fn fh_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the halfedges of a face loop, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fh_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, HH)>
fn fh_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, HH)>
Iterator over the halfedges in a face loop, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fe_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, EH)>
fn fe_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, EH)>
Iterator over the edges incident on a face, going counter-clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn fe_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, EH)>
fn fe_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, EH)>
Iterator over the edges incident on a face, going clockwise.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn ff_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, FH)>
fn ff_ccw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, FH)>
Iterator over the neighboring faces around a given face, going counter-clockwise.
This includes the faces connected via a shared edge, but not those connected via shared edge.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn ff_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, FH)>
fn ff_cw_iter_mut(&mut self, f: FH) -> impl Iterator<Item = (&mut Self, FH)>
Iterator over the neighboring faces around a given face, going clockwise.
This includes the faces connected via a shared edge, but not those connected via shared edge.
A mutable iterator allows modifying the mesh while iterating over its elements. See this section for an overview on mutable iterators.
Sourcefn ccw_rotate_iter_mut(
&mut self,
h: HH,
) -> impl Iterator<Item = (&mut Self, HH)>
fn ccw_rotate_iter_mut( &mut self, h: HH, ) -> impl Iterator<Item = (&mut Self, HH)>
This is similar to Self::voh_ccw_iter_mut around the tail of the
given halfedge, except this iterator starts at the provided halfedge.
This is equivalent to a circular shifted Self::voh_ccw_iter_mut of
the vertex at the tail of the given halfedge. A mutable iterator allows
modifying the mesh while iterating over its elements. See this
section for an overview on
mutable iterators.
Sourcefn cw_rotate_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
fn cw_rotate_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
This is similar to Self::voh_cw_iter_mut around the tail of the
given halfedge, except this iterator starts at the provided halfedge.
This is equivalent to a circular shifted Self::voh_cw_iter_mut of
the vertex at the tail of the given halfedge. A mutable iterator allows
modifying the mesh while iterating over its elements. See this
section for an overview on
mutable iterators.
Sourcefn loop_ccw_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
fn loop_ccw_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
Counter-clockwise iterator over the halfedges in a loop.
The iterator will start at the given halfedge. If the halfedge has an
incident face, this iterator is equivalent to a circular shifted
Self::fh_ccw_iter_mut of the incident face. If the halfedge is on
the boundary, this iterator goes over the boundary loop
counter-clockwise. A mutable iterator allows modifying the mesh while
iterating over its elements. See this
section for an overview on
mutable iterators.
Sourcefn loop_cw_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
fn loop_cw_iter_mut(&mut self, h: HH) -> impl Iterator<Item = (&mut Self, HH)>
Counter-clockwise iterator over the halfedges in a loop.
The iterator will start at the given halfedge. If the halfedge has an
incident face, this iterator is equivalent to a circular shifted
Self::fh_cw_iter_mut of the incident face. If the halfedge is on the
boundary, this iterator goes over the boundary loop clockwise. A mutable
iterator allows modifying the mesh while iterating over its
elements. See this section for
an overview on mutable iterators.
Sourcefn triangulated_face_vertices(&self, f: FH) -> impl Iterator<Item = [VH; 3]>
fn triangulated_face_vertices(&self, f: FH) -> impl Iterator<Item = [VH; 3]>
Iterator over the vertex triplets that represent a triangulation of the given face.
The triangulation does not take the shape of the face into account. It only accounts for the topology of the face.
use alum::{PolyMeshF32, Handle, HasTopology, HasIterators, Vec3};
let mut mesh = PolyMeshF32::new();
let verts = [Vec3(0.0, 0.0, 0.0), Vec3(1.0, 0.0, 0.0),
Vec3(1.0, 1.0, 0.0), Vec3(0.0, 1.0, 0.0)];
mesh.add_vertices(&verts).expect("Cannot add vertices");
mesh.add_quad_face(0.into(), 1.into(), 2.into(), 3.into());
assert_eq!(mesh.triangulated_face_vertices(0.into())
.flatten()
.map(|v| v.index())
.collect::<Vec<u32>>(), [3, 0, 1, 3, 1, 2]);Sourcefn triangulated_loop_vertices(
&self,
hstart: HH,
) -> impl Iterator<Item = [VH; 3]>
fn triangulated_loop_vertices( &self, hstart: HH, ) -> impl Iterator<Item = [VH; 3]>
Iterator over the vertex triplets that represent a triangulation of the
given loop. Unlike Self::triangulated_face_vertices, this can be
used on face loops as well as boundary loops. For example, this can be
used to fill a boundary loop with triangles.
The triangulation does not take the shape of the loop into account. It only accounts for the topology of the face.
Sourcefn triangulated_vertices(
&self,
fstatus: &FPropBuf<Status>,
) -> impl Iterator<Item = [VH; 3]>
fn triangulated_vertices( &self, fstatus: &FPropBuf<Status>, ) -> impl Iterator<Item = [VH; 3]>
Iterator over the vertex triplets that represent a triangulation of this mesh. The triangulation of a face does not take it’s shape into account. It only accounts for the topology.
use alum::{PolyMeshF32, Handle, HasTopology, HasIterators, Vec3};
let mut mesh = PolyMeshF32::new();
let verts = [Vec3(0.0, 0.0, 0.0), Vec3(1.0, 0.0, 0.0),
Vec3(1.0, 1.0, 0.0), Vec3(0.0, 1.0, 0.0)];
mesh.add_vertices(&verts).expect("Cannot add vertices");
mesh.add_quad_face(0.into(), 1.into(), 2.into(), 3.into());
let fstatus = mesh.face_status_prop();
let fstatus = fstatus.try_borrow().unwrap();
assert_eq!(mesh.triangulated_vertices(&fstatus)
.flatten()
.map(|v| v.index())
.collect::<Vec<u32>>(), [3, 0, 1, 3, 1, 2]);Sourcefn find_halfedge(&self, from: VH, to: VH) -> Option<HH>
fn find_halfedge(&self, from: VH, to: VH) -> Option<HH>
Find a halfedge spanning the vertices from and to, if one exists
Sourcefn adjust_outgoing_halfedge(&mut self, v: VH)
fn adjust_outgoing_halfedge(&mut self, v: VH)
Adjust the outgoing halfedge of a vertex, if necessary.
If a vertex is on the boundary, it’s outgoing halfedge MUST be a boundary halfedge.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.