From 599008b865b72798595280597d31af03b0d625c8 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 21 Feb 2023 13:01:44 +0100 Subject: [PATCH] Avoid using `Curve::global_form` --- .../fj-kernel/src/algorithms/approx/curve.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/approx/curve.rs b/crates/fj-kernel/src/algorithms/approx/curve.rs index ec119345c..21d4d05df 100644 --- a/crates/fj-kernel/src/algorithms/approx/curve.rs +++ b/crates/fj-kernel/src/algorithms/approx/curve.rs @@ -218,6 +218,7 @@ mod tests { builder::{CurveBuilder, SurfaceBuilder}, geometry::path::GlobalPath, insert::Insert, + objects::GlobalCurve, partial::{PartialCurve, PartialObject, PartialSurface}, services::Services, }; @@ -234,11 +235,10 @@ mod tests { let curve = curve .build(&mut services.objects) .insert(&mut services.objects); + let global_curve = GlobalCurve.insert(&mut services.objects); let range = RangeOnPath::from([[0.], [1.]]); - let approx = - (&curve, surface.deref(), curve.global_form().clone(), range) - .approx(1.); + let approx = (&curve, surface.deref(), global_curve, range).approx(1.); assert_eq!(approx, CurveApprox::empty()); } @@ -258,11 +258,10 @@ mod tests { let curve = curve .build(&mut services.objects) .insert(&mut services.objects); + let global_curve = GlobalCurve.insert(&mut services.objects); let range = RangeOnPath::from([[0.], [1.]]); - let approx = - (&curve, surface.deref(), curve.global_form().clone(), range) - .approx(1.); + let approx = (&curve, surface.deref(), global_curve, range).approx(1.); assert_eq!(approx, CurveApprox::empty()); } @@ -280,13 +279,13 @@ mod tests { let curve = curve .build(&mut services.objects) .insert(&mut services.objects); + let global_curve = GlobalCurve.insert(&mut services.objects); let range = RangeOnPath::from([[0.], [TAU]]); let tolerance = 1.; let approx = - (&curve, surface.deref(), curve.global_form().clone(), range) - .approx(tolerance); + (&curve, surface.deref(), global_curve, range).approx(tolerance); let expected_approx = (path, range) .approx(tolerance) @@ -312,12 +311,12 @@ mod tests { let curve = curve .build(&mut services.objects) .insert(&mut services.objects); + let global_curve = GlobalCurve.insert(&mut services.objects); let range = RangeOnPath::from([[0.], [TAU]]); let tolerance = 1.; let approx = - (&curve, surface.deref(), curve.global_form().clone(), range) - .approx(tolerance); + (&curve, surface.deref(), global_curve, range).approx(tolerance); let expected_approx = (curve.path(), range) .approx(tolerance)