From 29366b44956247f147bcabd55746c8c95adbb7e5 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Mar 2025 23:00:30 +0100 Subject: [PATCH] Add `TriMesh::merge` --- crates/fj-interop/src/tri_mesh.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/fj-interop/src/tri_mesh.rs b/crates/fj-interop/src/tri_mesh.rs index fb399b025..be6729e3b 100644 --- a/crates/fj-interop/src/tri_mesh.rs +++ b/crates/fj-interop/src/tri_mesh.rs @@ -17,6 +17,15 @@ impl TriMesh { Self::default() } + /// # Add all the triangles from another `TriMesh` to this one + /// + /// This is literally all this method does. There's nothing fancy going on, + /// no de-duplication, no validation. Make sure this is what you want! + pub fn merge(mut self, other: Self) -> Self { + self.triangles.extend(other.triangles); + self + } + /// Determine whether the mesh contains the provided triangle /// /// Returns true, if a triangle with any combination of the provided points