Refactor to simplify

This commit is contained in:
Hanno Braun 2024-03-22 16:40:50 +01:00
parent b932737115
commit 7488920e90

View File

@ -1,7 +1,8 @@
use crate::{ use crate::{
geometry::HalfEdgeGeometry,
objects::{Cycle, HalfEdge}, objects::{Cycle, HalfEdge},
operations::{derive::DeriveFrom, insert::Insert}, operations::{
derive::DeriveFrom, geometry::UpdateHalfEdgeGeometry, insert::Insert,
},
Core, Core,
}; };
@ -15,21 +16,15 @@ impl Reverse for Cycle {
.map(|(current, next)| { .map(|(current, next)| {
let path = core.layers.geometry.of_half_edge(current).path; let path = core.layers.geometry.of_half_edge(current).path;
let half_edge = HalfEdge::new( HalfEdge::new(
path, path,
current.boundary().reverse(), current.boundary().reverse(),
current.curve().clone(), current.curve().clone(),
next.start_vertex().clone(), next.start_vertex().clone(),
) )
.insert(core) .insert(core)
.derive_from(current, core); .derive_from(current, core)
.set_path(path, &mut core.layers.geometry)
core.layers.geometry.define_half_edge(
half_edge.clone(),
HalfEdgeGeometry { path },
);
half_edge
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();