mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 01:48:28 +00:00
Implement GenTriMesh
for types that deref to it
This commit is contained in:
parent
a9ed3ba790
commit
1c0ad95e67
@ -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<Point<2>>;
|
||||
}
|
||||
|
||||
impl<T> 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<Point<2>> {
|
||||
self.deref().generate_tri_mesh(boundary, tolerance)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user