mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-08 17:27:20 +00:00
Remove redundant access to vector curve coords
This commit is contained in:
parent
ab19d3f72a
commit
71f62809c5
@ -65,7 +65,7 @@ impl Circle {
|
|||||||
/// Convert a vector on the curve into model coordinates
|
/// Convert a vector on the curve into model coordinates
|
||||||
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
|
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
|
||||||
let radius = self.radius.magnitude();
|
let radius = self.radius.magnitude();
|
||||||
let angle = point.t();
|
let angle = point.t;
|
||||||
|
|
||||||
let (sin, cos) = angle.sin_cos();
|
let (sin, cos) = angle.sin_cos();
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ impl Line {
|
|||||||
|
|
||||||
/// Convert a vector on the curve into model coordinates
|
/// Convert a vector on the curve into model coordinates
|
||||||
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
|
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
|
||||||
self.direction * point.t()
|
self.direction * point.t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ impl<const D: usize> Point<D> {
|
|||||||
impl Point<1> {
|
impl Point<1> {
|
||||||
/// Access the curve point's t coordinate
|
/// Access the curve point's t coordinate
|
||||||
pub fn t(&self) -> Scalar {
|
pub fn t(&self) -> Scalar {
|
||||||
self.coords.t()
|
self.coords.t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,13 +63,6 @@ impl<const D: usize> Vector<D> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Vector<1> {
|
|
||||||
/// Access the curve vector's t coordinate
|
|
||||||
pub fn t(&self) -> Scalar {
|
|
||||||
self.0[0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Vector<2> {
|
impl Vector<2> {
|
||||||
/// Extend a 2-dimensional vector into a 3-dimensional one
|
/// Extend a 2-dimensional vector into a 3-dimensional one
|
||||||
pub fn to_xyz(&self, z: Scalar) -> Vector<3> {
|
pub fn to_xyz(&self, z: Scalar) -> Vector<3> {
|
||||||
|
Loading…
Reference in New Issue
Block a user