diff --git a/crates/fj-kernel/src/objects/cycle.rs b/crates/fj-kernel/src/objects/cycle.rs index 518064a22..7a5e12769 100644 --- a/crates/fj-kernel/src/objects/cycle.rs +++ b/crates/fj-kernel/src/objects/cycle.rs @@ -1,3 +1,5 @@ +use std::slice; + use fj_interop::ext::SliceExt; use fj_math::{Scalar, Winding}; use pretty_assertions::assert_eq; @@ -76,7 +78,7 @@ impl Cycle { } /// Access the half-edges that make up the cycle - pub fn half_edges(&self) -> impl Iterator> + '_ { + pub fn half_edges(&self) -> HalfEdgesOfCycle { self.half_edges.iter() } @@ -138,3 +140,8 @@ impl Cycle { unreachable!("Encountered invalid cycle: {self:#?}"); } } + +/// An iterator over the half-edges of a [`Cycle`] +/// +/// Returned by [`Cycle::half_edges`]. +pub type HalfEdgesOfCycle<'a> = slice::Iter<'a, Handle>; diff --git a/crates/fj-kernel/src/objects/mod.rs b/crates/fj-kernel/src/objects/mod.rs index bdba01e72..07a37bd53 100644 --- a/crates/fj-kernel/src/objects/mod.rs +++ b/crates/fj-kernel/src/objects/mod.rs @@ -85,7 +85,7 @@ mod vertex; pub use self::{ curve::{Curve, GlobalCurve}, - cycle::Cycle, + cycle::{Cycle, HalfEdgesOfCycle}, edge::{GlobalEdge, HalfEdge, VerticesInNormalizedOrder}, face::{Face, FaceSet, Handedness}, shell::Shell,