From 05cc5939bd53c87acf9d8a69a1be56f04545fd50 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 21 Mar 2023 15:26:12 +0100 Subject: [PATCH] Fix winding algorithm not going back to start --- crates/fj-kernel/src/objects/full/cycle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/objects/full/cycle.rs b/crates/fj-kernel/src/objects/full/cycle.rs index e0fde16b5..95e44fb7a 100644 --- a/crates/fj-kernel/src/objects/full/cycle.rs +++ b/crates/fj-kernel/src/objects/full/cycle.rs @@ -1,7 +1,7 @@ use std::slice; -use fj_interop::ext::SliceExt; use fj_math::{Scalar, Winding}; +use itertools::Itertools; use crate::{geometry::curve::Curve, objects::HalfEdge, storage::Handle}; @@ -62,7 +62,7 @@ impl Cycle { let mut sum = Scalar::ZERO; - for [a, b] in self.half_edges.as_slice().array_windows_ext() { + for (a, b) in self.half_edges.iter().circular_tuple_windows() { let [a, b] = [a, b].map(|half_edge| half_edge.start_position()); sum += (b.u - a.u) * (b.v + a.v);