File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,11 @@ use spade::Triangulation;
9
9
use crate :: {
10
10
geometry:: { MeshTriangle , TriMesh , Triangle } ,
11
11
math:: Point ,
12
- object:: Handle ,
13
- topology:: { face:: Face , half_edge:: HalfEdge , surface:: Surface } ,
12
+ topology:: face:: Face ,
14
13
} ;
15
14
16
15
pub fn triangulate ( face : & Face ) -> TriMesh {
17
- let points = points ( & face. half_edges , & face . surface ) ;
16
+ let points = points ( face) ;
18
17
let triangles = triangles ( & points) ;
19
18
20
19
let polygon = polygon ( & points) ;
@@ -41,11 +40,8 @@ pub fn triangulate(face: &Face) -> TriMesh {
41
40
mesh
42
41
}
43
42
44
- fn points (
45
- half_edges : & [ Handle < HalfEdge > ] ,
46
- surface : & Surface ,
47
- ) -> Vec < TriangulationPoint > {
48
- half_edges
43
+ fn points ( face : & Face ) -> Vec < TriangulationPoint > {
44
+ face. half_edges
49
45
. iter ( )
50
46
. map ( |half_edge| {
51
47
// Here, we project a 3D point (from the vertex) into the face's
@@ -66,7 +62,7 @@ fn points(
66
62
// original 3D points to build those triangles. We never convert
67
63
// the 2D points back into 3D.
68
64
let point_surface =
69
- surface. geometry . project_point ( half_edge. start . point ) ;
65
+ face . surface . geometry . project_point ( half_edge. start . point ) ;
70
66
71
67
TriangulationPoint {
72
68
point_surface,
You can’t perform that action at this time.
0 commit comments