Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 27, 2023
1 parent ec0987c commit 2289859
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions crates/fj-core/src/operations/build/face.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::array;

use fj_interop::ext::ArrayExt;
use fj_math::Point;

Expand Down Expand Up @@ -33,16 +35,15 @@ pub trait BuildFace {
let mut half_edges = face.region().exterior().half_edges().cloned();
assert_eq!(half_edges.clone().count(), 3);

[half_edges.next(), half_edges.next(), half_edges.next()].map(
|half_edge| {
half_edge
.expect("Just asserted that there are three half-edges")
},
)
array::from_fn(|_| half_edges.next()).map(|half_edge| {
half_edge
.expect("Just asserted that there are three half-edges")
})
};
let vertices = edges
.each_ref_ext()
.map(|half_edge| half_edge.start_vertex().clone());
let vertices =
edges.each_ref_ext().map(|half_edge: &Handle<HalfEdge>| {
half_edge.start_vertex().clone()
});

Polygon {
face,
Expand Down

0 comments on commit 2289859

Please sign in to comment.