Skip to content

Commit

Permalink
Merge pull request #1709 from hannobraun/winding
Browse files Browse the repository at this point in the history
Fix winding algorithm not going back to start
  • Loading branch information
hannobraun authored Mar 21, 2023
2 parents 8d4872a + 05cc593 commit 7059342
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/fj-kernel/src/objects/full/cycle.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7059342

Please sign in to comment.