mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-23 16:46:07 +00:00
Remove redundant access to vector surface coords
This commit is contained in:
parent
8256b5574a
commit
ab19d3f72a
@ -38,8 +38,7 @@ impl Swept {
|
|||||||
|
|
||||||
/// Convert a vector in surface coordinates to model coordinates
|
/// Convert a vector in surface coordinates to model coordinates
|
||||||
pub fn vector_surface_to_model(&self, vector: &Vector<2>) -> Vector<3> {
|
pub fn vector_surface_to_model(&self, vector: &Vector<2>) -> Vector<3> {
|
||||||
self.curve.vector_curve_to_model(&vector.to_t())
|
self.curve.vector_curve_to_model(&vector.to_t()) + self.path * vector.v
|
||||||
+ self.path * vector.v()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@ impl Point<1> {
|
|||||||
impl Point<2> {
|
impl Point<2> {
|
||||||
/// Access the point's x coordinate
|
/// Access the point's x coordinate
|
||||||
pub fn u(&self) -> Scalar {
|
pub fn u(&self) -> Scalar {
|
||||||
self.coords.u()
|
self.coords.u
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access the point's y coordinate
|
/// Access the point's y coordinate
|
||||||
pub fn v(&self) -> Scalar {
|
pub fn v(&self) -> Scalar {
|
||||||
self.coords.v()
|
self.coords.v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,19 +71,9 @@ impl Vector<1> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Vector<2> {
|
impl Vector<2> {
|
||||||
/// Access the surface vector's u coordinate
|
|
||||||
pub fn u(&self) -> Scalar {
|
|
||||||
self.0[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Access the surface vector's v coordinate
|
|
||||||
pub fn v(&self) -> Scalar {
|
|
||||||
self.0[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 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> {
|
||||||
Vector::from([self.u(), self.v(), z])
|
Vector::from([self.u, self.v, z])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user