From 567229816d817a321e0eca0b6aaa68736c0f034b Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Jun 2024 20:48:21 +0200 Subject: [PATCH] Simplify test --- crates/fj-core/src/algorithms/approx/curve.rs | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/fj-core/src/algorithms/approx/curve.rs b/crates/fj-core/src/algorithms/approx/curve.rs index 13bdfcfc5..3b2989c77 100644 --- a/crates/fj-core/src/algorithms/approx/curve.rs +++ b/crates/fj-core/src/algorithms/approx/curve.rs @@ -208,14 +208,14 @@ impl CurveApproxCache { mod tests { use std::f64::consts::TAU; - use fj_math::{Circle, Point}; + use fj_math::{Circle, Point, Vector}; use pretty_assertions::assert_eq; use crate::{ algorithms::approx::{ circle::approx_circle, curve::approx_curve, Approx, ApproxPoint, }, - geometry::{CurveBoundary, GlobalPath, SurfacePath}, + geometry::{CurveBoundary, GlobalPath, SurfaceGeom, SurfacePath}, operations::build::{BuildCurve, BuildSurface}, topology::{Curve, Surface}, Core, @@ -238,22 +238,16 @@ mod tests { #[test] fn approx_line_on_curved_surface_but_not_along_curve() { - let mut core = Core::new(); - - let surface = Surface::from_uv( - GlobalPath::circle_from_radius(1.), - [0., 0., 1.], - &mut core, - ); + let surface = SurfaceGeom { + u: GlobalPath::circle_from_radius(1.), + v: Vector::from([0., 0., 1.]), + }; let (path, boundary) = SurfacePath::line_from_points([[1., 1.], [2., 1.]]); - let curve = - Curve::from_path_and_surface(path, surface.clone(), &mut core); let boundary = CurveBoundary::from(boundary); let tolerance = 1.; - let approx = (&curve, &surface, boundary) - .approx(tolerance, &core.layers.geometry); + let approx = approx_curve(&path, &surface, boundary, tolerance); assert_eq!(approx.points, vec![]); }