Skip to content

Commit b23fa6c

Browse files
committed
Consolidate function parameters
1 parent 4a108d7 commit b23fa6c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

experiments/2024-12-09/src/extra/triangulate.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ use spade::Triangulation;
99
use crate::{
1010
geometry::{MeshTriangle, TriMesh, Triangle},
1111
math::Point,
12-
object::Handle,
13-
topology::{face::Face, half_edge::HalfEdge, surface::Surface},
12+
topology::face::Face,
1413
};
1514

1615
pub fn triangulate(face: &Face) -> TriMesh {
17-
let points = points(&face.half_edges, &face.surface);
16+
let points = points(face);
1817
let triangles = triangles(&points);
1918

2019
let polygon = polygon(&points);
@@ -41,11 +40,8 @@ pub fn triangulate(face: &Face) -> TriMesh {
4140
mesh
4241
}
4342

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
4945
.iter()
5046
.map(|half_edge| {
5147
// Here, we project a 3D point (from the vertex) into the face's
@@ -66,7 +62,7 @@ fn points(
6662
// original 3D points to build those triangles. We never convert
6763
// the 2D points back into 3D.
6864
let point_surface =
69-
surface.geometry.project_point(half_edge.start.point);
65+
face.surface.geometry.project_point(half_edge.start.point);
7066

7167
TriangulationPoint {
7268
point_surface,

0 commit comments

Comments
 (0)