diff --git a/crates/fj-core/src/algorithms/approx/cycle.rs b/crates/fj-core/src/algorithms/approx/cycle.rs index 0a17cd2ba..dfedcdf38 100644 --- a/crates/fj-core/src/algorithms/approx/cycle.rs +++ b/crates/fj-core/src/algorithms/approx/cycle.rs @@ -12,6 +12,7 @@ use crate::{ use super::{ half_edge::{approx_half_edge, HalfEdgeApprox}, + vertex::approx_vertex, ApproxCache, ApproxPoint, Tolerance, }; @@ -30,12 +31,23 @@ pub fn approx_cycle( .iter() .map(|half_edge| { let boundary = geometry.of_half_edge(half_edge).boundary; + let [start_position_curve, _] = boundary.inner; + + let start = approx_vertex( + half_edge.start_vertex().clone(), + half_edge.curve(), + surface, + start_position_curve, + &mut cache.vertex, + geometry, + ); + approx_half_edge( half_edge, surface, + start, boundary, tolerance, - &mut cache.vertex, &mut cache.curve, geometry, ) diff --git a/crates/fj-core/src/algorithms/approx/half_edge.rs b/crates/fj-core/src/algorithms/approx/half_edge.rs index 2a847b8c0..75dab518b 100644 --- a/crates/fj-core/src/algorithms/approx/half_edge.rs +++ b/crates/fj-core/src/algorithms/approx/half_edge.rs @@ -14,7 +14,6 @@ use crate::{ use super::{ curve::{approx_curve_with_cache, CurveApproxCache}, - vertex::{approx_vertex, VertexApproxCache}, ApproxPoint, Tolerance, }; @@ -22,25 +21,14 @@ use super::{ pub fn approx_half_edge( half_edge: &Handle, surface: &Handle, + start: ApproxPoint<1>, boundary: CurveBoundary>, tolerance: impl Into, - vertex_cache: &mut VertexApproxCache, curve_cache: &mut CurveApproxCache, geometry: &Geometry, ) -> HalfEdgeApprox { let tolerance = tolerance.into(); - let [start_position_curve, _] = boundary.inner; - - let start = approx_vertex( - half_edge.start_vertex().clone(), - half_edge.curve(), - surface, - start_position_curve, - vertex_cache, - geometry, - ); - let rest = approx_curve_with_cache( half_edge.curve(), surface,