mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-15 12:47:19 +00:00
Refactor
This commit is contained in:
parent
7f3519a98e
commit
b39c3ba097
@ -166,14 +166,7 @@ impl PartialCycle {
|
|||||||
let half_edges = {
|
let half_edges = {
|
||||||
let (half_edges, _) = self.half_edges.into_iter().fold(
|
let (half_edges, _) = self.half_edges.into_iter().fold(
|
||||||
(Vec::new(), None),
|
(Vec::new(), None),
|
||||||
|(mut half_edges, previous), next| {
|
|(mut half_edges, previous_vertex), next| {
|
||||||
let previous_half_edge: Option<HalfEdge> = previous;
|
|
||||||
|
|
||||||
let previous_vertex = previous_half_edge.map(|half_edge| {
|
|
||||||
let [_, vertex] = half_edge.vertices().clone();
|
|
||||||
vertex.surface_form().clone()
|
|
||||||
});
|
|
||||||
|
|
||||||
let next = next
|
let next = next
|
||||||
.update_partial(|half_edge| {
|
.update_partial(|half_edge| {
|
||||||
let [from, _] = half_edge.vertices.clone();
|
let [from, _] = half_edge.vertices.clone();
|
||||||
@ -189,9 +182,10 @@ impl PartialCycle {
|
|||||||
})
|
})
|
||||||
.into_full(objects);
|
.into_full(objects);
|
||||||
|
|
||||||
half_edges.push(next.clone());
|
let front = next.front().surface_form().clone();
|
||||||
|
half_edges.push(next);
|
||||||
|
|
||||||
(half_edges, Some(next))
|
(half_edges, Some(front))
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user