diff --git a/crates/fj-kernel/src/algorithms/validate/mod.rs b/crates/fj-kernel/src/algorithms/validate/mod.rs index ed4ec1880..20f880c8f 100644 --- a/crates/fj-kernel/src/algorithms/validate/mod.rs +++ b/crates/fj-kernel/src/algorithms/validate/mod.rs @@ -161,8 +161,8 @@ mod tests { use crate::{ algorithms::validate::{Validate, ValidationConfig, ValidationError}, objects::{ - Curve, GlobalCurve, GlobalVertex, HalfEdge, Surface, SurfaceVertex, - Vertex, + Curve, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Surface, + SurfaceVertex, Vertex, }, path::{GlobalPath, SurfacePath}, stores::Stores, @@ -236,7 +236,9 @@ mod tests { ); let vertices = [a, b]; - let half_edge = HalfEdge::from_curve_and_vertices(curve, vertices); + let global_edge = GlobalEdge::builder() + .build_from_curve_and_vertices(&curve, &vertices); + let half_edge = HalfEdge::new(curve, vertices, global_edge); let result = half_edge.clone().validate_with_config(&ValidationConfig { diff --git a/crates/fj-kernel/src/builder/edge.rs b/crates/fj-kernel/src/builder/edge.rs index a64fe39bb..c2c6899f4 100644 --- a/crates/fj-kernel/src/builder/edge.rs +++ b/crates/fj-kernel/src/builder/edge.rs @@ -57,7 +57,10 @@ impl<'a> HalfEdgeBuilder<'a> { ) }; - HalfEdge::from_curve_and_vertices(curve, vertices) + let global_form = GlobalEdge::builder() + .build_from_curve_and_vertices(&curve, &vertices); + + HalfEdge::new(curve, vertices, global_form) } /// Build a line segment from two points @@ -121,7 +124,10 @@ impl<'a> HalfEdgeBuilder<'a> { ] }; - HalfEdge::from_curve_and_vertices(curve, vertices) + let global_form = GlobalEdge::builder() + .build_from_curve_and_vertices(&curve, &vertices); + + HalfEdge::new(curve, vertices, global_form) } } diff --git a/crates/fj-kernel/src/objects/edge.rs b/crates/fj-kernel/src/objects/edge.rs index 63337133e..ee955d787 100644 --- a/crates/fj-kernel/src/objects/edge.rs +++ b/crates/fj-kernel/src/objects/edge.rs @@ -23,10 +23,6 @@ impl HalfEdge { /// Create a new instance of `HalfEdge` /// - /// If you only have a curve and the edge vertices, please check out - /// [`HalfEdge::from_curve_and_vertices`], which is a convenience wrapper - /// around this method, which creates an instance of [`GlobalEdge`]. - /// /// # Panics /// /// Panics, if the provided `vertices` are not defined on the same curve as @@ -76,20 +72,6 @@ impl HalfEdge { } } - /// Create a new instance of `HalfEdge` from a curve and vertices - /// - /// The [`GlobalEdge`] instance is created from the provided curve and - /// vertices. Please refer to [`HalfEdge::new`], if you already have a - /// [`GlobalEdge`] instance that you can provide. - pub fn from_curve_and_vertices( - curve: Curve, - vertices: [Vertex; 2], - ) -> Self { - let global = GlobalEdge::builder() - .build_from_curve_and_vertices(&curve, &vertices); - Self::new(curve, vertices, global) - } - /// Access the curve that defines the half-edge's geometry /// /// The edge can be a segment of the curve that is bounded by two vertices,