From 884c28416c038dbe293a5f02ba39c203ca1a65c4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 13 Aug 2024 18:58:04 +0200 Subject: [PATCH] Rewrite conversion function on top of `triangle_at` --- crates/fj-core/src/geometry/surface.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/crates/fj-core/src/geometry/surface.rs b/crates/fj-core/src/geometry/surface.rs index c1aa94c44..8a5348a6f 100644 --- a/crates/fj-core/src/geometry/surface.rs +++ b/crates/fj-core/src/geometry/surface.rs @@ -1,6 +1,6 @@ //! The geometry that defines a surface -use fj_math::{Line, Point, Scalar, Transform, Triangle, Vector}; +use fj_math::{Point, Scalar, Transform, Triangle, Vector}; use crate::algorithms::approx::{PathApproxParams, Tolerance}; @@ -137,17 +137,12 @@ impl SurfaceGeom { pub fn vector_from_surface_coords( &self, vector: impl Into>, - _: impl Into, + tolerance: impl Into, ) -> Vector<3> { let vector = vector.into(); - let Self::Basic { u, .. } = self; - u.vector_from_path_coords([vector.u]) - + self.path_to_line().vector_from_line_coords([vector.v]) - } - - fn path_to_line(&self) -> Line<3> { - let Self::Basic { u, v } = self; - Line::from_origin_and_direction(u.origin(), *v) + let point = + self.point_from_surface_coords(Point { coords: vector }, tolerance); + point - self.origin() } /// Transform the surface geometry