Circumvent redundant code in circle approximation

This commit is contained in:
Hanno Braun 2024-06-21 19:49:05 +02:00
parent d6c17fe3f4
commit fdb92762ab

View File

@ -10,7 +10,7 @@ use crate::{
topology::{Curve, Surface}, topology::{Curve, Surface},
}; };
use super::{Approx, ApproxPoint, Tolerance}; use super::{path::approx_circle, Approx, ApproxPoint, Tolerance};
impl Approx for (&Handle<Curve>, &Handle<Surface>, CurveBoundary<Point<1>>) { impl Approx for (&Handle<Curve>, &Handle<Surface>, CurveBoundary<Point<1>>) {
type Approximation = CurveApprox; type Approximation = CurveApprox;
@ -65,9 +65,8 @@ fn approx_curve(
"Approximating a circle on a curved surface not supported yet." "Approximating a circle on a curved surface not supported yet."
) )
} }
(SurfacePath::Circle(_), GlobalPath::Line(_)) => { (SurfacePath::Circle(circle), GlobalPath::Line(_)) => {
(path, boundary) approx_circle(circle, boundary, tolerance)
.approx_with_cache(tolerance, &mut (), geometry)
.into_iter() .into_iter()
.map(|(point_curve, point_surface)| { .map(|(point_curve, point_surface)| {
// We're throwing away `point_surface` here, which is a // We're throwing away `point_surface` here, which is a