From 3ece8031eb4fb94224fed1eb5c01e7328b3db138 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Sun, 16 Nov 2025 11:30:01 +0100 Subject: [PATCH] Simplify point operations that used nalgebra --- crates/fj-math/src/point.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/fj-math/src/point.rs b/crates/fj-math/src/point.rs index 5d46a3909..f0caa0be1 100644 --- a/crates/fj-math/src/point.rs +++ b/crates/fj-math/src/point.rs @@ -149,7 +149,9 @@ impl ops::Neg for Point { type Output = Self; fn neg(self) -> Self::Output { - self.to_na().neg().into() + Self { + coords: self.coords.neg(), + } } } @@ -157,7 +159,7 @@ impl ops::Sub for Point { type Output = Vector; fn sub(self, rhs: Self) -> Self::Output { - self.to_na().sub(rhs.to_na()).into() + self.coords.sub(rhs.coords) } } @@ -212,7 +214,9 @@ where type Output = Self; fn add(self, rhs: V) -> Self::Output { - self.to_na().add(rhs.into().to_na()).into() + Self { + coords: self.coords.add(rhs), + } } } @@ -232,7 +236,9 @@ where type Output = Self; fn sub(self, rhs: V) -> Self::Output { - self.to_na().sub(rhs.into().to_na()).into() + Self { + coords: self.coords.sub(rhs), + } } }