From 71f62809c55fe3610c7bf44adafcca058a6d3c01 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Sun, 20 Feb 2022 12:41:03 +0100 Subject: [PATCH] Remove redundant access to vector curve coords --- src/kernel/geometry/curves/circle.rs | 2 +- src/kernel/geometry/curves/line.rs | 2 +- src/math/point.rs | 2 +- src/math/vector.rs | 7 ------- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/kernel/geometry/curves/circle.rs b/src/kernel/geometry/curves/circle.rs index 0f9aafa93..436bc038b 100644 --- a/src/kernel/geometry/curves/circle.rs +++ b/src/kernel/geometry/curves/circle.rs @@ -65,7 +65,7 @@ impl Circle { /// Convert a vector on the curve into model coordinates pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> { let radius = self.radius.magnitude(); - let angle = point.t(); + let angle = point.t; let (sin, cos) = angle.sin_cos(); diff --git a/src/kernel/geometry/curves/line.rs b/src/kernel/geometry/curves/line.rs index 58e1dd6d1..d7af97b32 100644 --- a/src/kernel/geometry/curves/line.rs +++ b/src/kernel/geometry/curves/line.rs @@ -53,7 +53,7 @@ impl Line { /// Convert a vector on the curve into model coordinates pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> { - self.direction * point.t() + self.direction * point.t } } diff --git a/src/math/point.rs b/src/math/point.rs index 3a3099806..0664479d7 100644 --- a/src/math/point.rs +++ b/src/math/point.rs @@ -58,7 +58,7 @@ impl Point { impl Point<1> { /// Access the curve point's t coordinate pub fn t(&self) -> Scalar { - self.coords.t() + self.coords.t } } diff --git a/src/math/vector.rs b/src/math/vector.rs index cef23dda8..86f31eaf7 100644 --- a/src/math/vector.rs +++ b/src/math/vector.rs @@ -63,13 +63,6 @@ impl Vector { } } -impl Vector<1> { - /// Access the curve vector's t coordinate - pub fn t(&self) -> Scalar { - self.0[0] - } -} - impl Vector<2> { /// Extend a 2-dimensional vector into a 3-dimensional one pub fn to_xyz(&self, z: Scalar) -> Vector<3> {