From e1edb64c6f4993cf5f39882b021189a6a5448ab7 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Sun, 20 Feb 2022 13:34:01 +0100 Subject: [PATCH] Remove redundant access to point surface coords --- src/kernel/geometry/surfaces/swept.rs | 2 +- src/kernel/triangulation.rs | 4 ++-- src/math/point.rs | 12 ------------ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/kernel/geometry/surfaces/swept.rs b/src/kernel/geometry/surfaces/swept.rs index d85bdea6f..be2c49fee 100644 --- a/src/kernel/geometry/surfaces/swept.rs +++ b/src/kernel/geometry/surfaces/swept.rs @@ -33,7 +33,7 @@ impl Swept { /// Convert a point in surface coordinates to model coordinates pub fn point_surface_to_model(&self, point: &Point<2>) -> Point<3> { - self.curve.point_curve_to_model(&point.to_t()) + self.path * point.v() + self.curve.point_curve_to_model(&point.to_t()) + self.path * point.v } /// Convert a vector in surface coordinates to model coordinates diff --git a/src/kernel/triangulation.rs b/src/kernel/triangulation.rs index 3d42f769f..71ef56fb4 100644 --- a/src/kernel/triangulation.rs +++ b/src/kernel/triangulation.rs @@ -40,8 +40,8 @@ impl HasPosition for SurfacePoint { fn position(&self) -> spade::Point2 { spade::Point2 { - x: self.value.u(), - y: self.value.v(), + x: self.value.u, + y: self.value.v, } } } diff --git a/src/math/point.rs b/src/math/point.rs index a77f77922..2dafbc30d 100644 --- a/src/math/point.rs +++ b/src/math/point.rs @@ -60,18 +60,6 @@ impl Point<1> { } } -impl Point<2> { - /// Access the point's x coordinate - pub fn u(&self) -> Scalar { - self.coords.u - } - - /// Access the point's y coordinate - pub fn v(&self) -> Scalar { - self.coords.v - } -} - impl ops::Deref for Point<1> { type Target = T;