diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index b67dfee78..3a415897d 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -1,10 +1,21 @@ +use fj_math::Point; + use crate::{ + geometry::{CurveBoundary, SurfacePath}, objects::{Curve, GlobalEdge, HalfEdge, Vertex}, storage::Handle, }; /// Update a [`HalfEdge`] pub trait UpdateHalfEdge { + /// Replace the path of the half-edge + #[must_use] + fn replace_path(&self, path: SurfacePath) -> Self; + + /// Replace the boundary of the half-edge + #[must_use] + fn replace_boundary(&self, boundary: CurveBoundary>) -> Self; + /// Replace the curve of the half-edge #[must_use] fn replace_curve(&self, curve: Handle) -> Self; @@ -19,6 +30,26 @@ pub trait UpdateHalfEdge { } impl UpdateHalfEdge for HalfEdge { + fn replace_path(&self, path: SurfacePath) -> Self { + HalfEdge::new( + path, + self.boundary(), + self.curve().clone(), + self.start_vertex().clone(), + self.global_form().clone(), + ) + } + + fn replace_boundary(&self, boundary: CurveBoundary>) -> Self { + HalfEdge::new( + self.path(), + boundary, + self.curve().clone(), + self.start_vertex().clone(), + self.global_form().clone(), + ) + } + fn replace_curve(&self, curve: Handle) -> Self { HalfEdge::new( self.path(),