From 1cfaaeab31ea0161d0746ec9b9080af1c4a044db Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 16 Apr 2025 10:40:35 +0200 Subject: [PATCH] Simplify function parameter --- crates/fj-core/src/geometry/curves/circle.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/geometry/curves/circle.rs b/crates/fj-core/src/geometry/curves/circle.rs index eb7b920a3..484978925 100644 --- a/crates/fj-core/src/geometry/curves/circle.rs +++ b/crates/fj-core/src/geometry/curves/circle.rs @@ -56,7 +56,7 @@ impl GenPolyline for Circle { tolerance: Tolerance, ) -> Vec> { let params = CircleApproxParams::new(self, tolerance); - params.approx_circle(boundary).collect() + params.approx_circle(boundary.inner).collect() } } @@ -94,10 +94,8 @@ impl CircleApproxParams { /// # Generate points to approximate the circle within a given boundary pub fn approx_circle( &self, - boundary: impl Into>>, + boundary: [Point<1>; 2], ) -> impl Iterator> + '_ { - let boundary = boundary.into().inner; - let [a, b] = boundary.map(|point| point.t / self.increment); let direction = (b - a).sign(); let [min, max] = if a < b { [a, b] } else { [b, a] }; @@ -202,7 +200,9 @@ mod tests { let circle = Circle::from_center_and_radius([0., 0.], radius); let params = CircleApproxParams::new(&circle, tolerance); - let points = params.approx_circle(boundary).collect::>(); + let points = params + .approx_circle(boundary.into().inner) + .collect::>(); let expected_points = expected_coords .into_iter()