mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-27 20:36:06 +00:00
Add Plane::normal
This commit is contained in:
parent
5778366e00
commit
f3fb458f2c
@ -7,6 +7,11 @@ pub struct Plane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Plane {
|
impl Plane {
|
||||||
|
#[allow(unused)] // code to use it is being worked on
|
||||||
|
pub fn normal(&self) -> Vector<3> {
|
||||||
|
self.coords.a.cross(self.coords.b).normalize()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn point_from_local(&self, point: impl Into<Point<2>>) -> Point<3> {
|
pub fn point_from_local(&self, point: impl Into<Point<2>>) -> Point<3> {
|
||||||
let [u, v] = point.into().coords.components;
|
let [u, v] = point.into().coords.components;
|
||||||
self.origin + self.coords.a * u + self.coords.b * v
|
self.origin + self.coords.a * u + self.coords.b * v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user