diff --git a/crates/fj-core/src/geometry/traits.rs b/crates/fj-core/src/geometry/traits.rs index 76d242403..433fcb039 100644 --- a/crates/fj-core/src/geometry/traits.rs +++ b/crates/fj-core/src/geometry/traits.rs @@ -17,6 +17,8 @@ //! system to the new one based on uniform representation is still ongoing. As a //! result of that, this module might still be incomplete. +use std::ops::Deref; + use fj_math::{Aabb, LineSegment, Point, Scalar, Triangle}; use super::{CurveBoundary, Path, Tolerance}; @@ -147,3 +149,29 @@ pub trait GenTriMesh { tolerance: Tolerance, ) -> Vec>; } + +impl GenTriMesh for T +where + T: Deref, + T::Target: GenTriMesh, +{ + fn origin(&self) -> Point<3> { + self.deref().origin() + } + + fn triangle_at( + &self, + point_surface: Point<2>, + tolerance: Tolerance, + ) -> (Triangle<3>, [Scalar; 3]) { + self.deref().triangle_at(point_surface, tolerance) + } + + fn generate_tri_mesh( + &self, + boundary: Aabb<2>, + tolerance: Tolerance, + ) -> Vec> { + self.deref().generate_tri_mesh(boundary, tolerance) + } +}