diff --git a/crates/fj-math/src/triangle.rs b/crates/fj-math/src/triangle.rs index 5775d9d6b..92dc8ec37 100644 --- a/crates/fj-math/src/triangle.rs +++ b/crates/fj-math/src/triangle.rs @@ -87,6 +87,15 @@ impl Triangle<3> { .cast_local_ray(&ray, max_toi, solid) .map(|f| f.into()) } + + /// Compute the triangle's normal + pub fn normal(&self) -> Vector<3> { + self.to_parry() + .normal() + .expect("triangle is valid (validated on construction)") + .into_inner() + .into() + } } impl
From<[P; 3]> for Triangle