From 65bb42ba546d8b494b66cd326b8db4287e1fa39f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Mar 2025 21:28:14 +0100 Subject: [PATCH] Prepare to use `TriMesh` in latest experiment --- crates/fj-core/src/algorithms/triangulate/mod.rs | 1 + crates/fj-interop/src/tri_mesh.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/fj-core/src/algorithms/triangulate/mod.rs b/crates/fj-core/src/algorithms/triangulate/mod.rs index 951dae1fe..4929d6840 100644 --- a/crates/fj-core/src/algorithms/triangulate/mod.rs +++ b/crates/fj-core/src/algorithms/triangulate/mod.rs @@ -70,6 +70,7 @@ impl Triangulate for FaceApprox { let points = triangle.map(|point| point.point_global); mesh.triangles.push(MeshTriangle { inner: points.into(), + is_internal: false, color, }); } diff --git a/crates/fj-interop/src/tri_mesh.rs b/crates/fj-interop/src/tri_mesh.rs index c6006c4eb..fb399b025 100644 --- a/crates/fj-interop/src/tri_mesh.rs +++ b/crates/fj-interop/src/tri_mesh.rs @@ -50,6 +50,16 @@ pub struct MeshTriangle { /// # The triangle pub inner: Triangle<3>, + /// # Track whether this is an internal triangle + /// + /// Internal triangles are triangles that are inside of the solid body that + /// the triangle mesh is a boundary for. + /// + /// If the triangle mesh is well-formed, then internal triangles are still + /// part of a single contiguous outer shell. But this shell might touch + /// itself, making the triangles where that is the case internal. + pub is_internal: bool, + /// # The color of the triangle pub color: Color, }