From fdb92762ab5a8042286fe9c01153da583b10a69d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Jun 2024 19:49:05 +0200 Subject: [PATCH] Circumvent redundant code in circle approximation --- crates/fj-core/src/algorithms/approx/curve.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/fj-core/src/algorithms/approx/curve.rs b/crates/fj-core/src/algorithms/approx/curve.rs index a9b0b207b..564ecf70a 100644 --- a/crates/fj-core/src/algorithms/approx/curve.rs +++ b/crates/fj-core/src/algorithms/approx/curve.rs @@ -10,7 +10,7 @@ use crate::{ topology::{Curve, Surface}, }; -use super::{Approx, ApproxPoint, Tolerance}; +use super::{path::approx_circle, Approx, ApproxPoint, Tolerance}; impl Approx for (&Handle, &Handle, CurveBoundary>) { type Approximation = CurveApprox; @@ -65,9 +65,8 @@ fn approx_curve( "Approximating a circle on a curved surface not supported yet." ) } - (SurfacePath::Circle(_), GlobalPath::Line(_)) => { - (path, boundary) - .approx_with_cache(tolerance, &mut (), geometry) + (SurfacePath::Circle(circle), GlobalPath::Line(_)) => { + approx_circle(circle, boundary, tolerance) .into_iter() .map(|(point_curve, point_surface)| { // We're throwing away `point_surface` here, which is a