From 8b75e1b7fbd1842b8cc32c0670a13615e9837880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Wed, 13 Nov 2024 11:49:11 +0100 Subject: [PATCH] feat: switch to a deterministic hashmap in the mesh intersection algorithm --- src/transformation/mesh_intersection/mesh_intersection.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/transformation/mesh_intersection/mesh_intersection.rs b/src/transformation/mesh_intersection/mesh_intersection.rs index bbef18e3..4a65871e 100644 --- a/src/transformation/mesh_intersection/mesh_intersection.rs +++ b/src/transformation/mesh_intersection/mesh_intersection.rs @@ -8,7 +8,8 @@ use na::{Point3, Vector3}; use rstar::RTree; use spade::{ConstrainedDelaunayTriangulation, InsertionError, Triangulation as _}; use std::collections::BTreeMap; -use std::collections::{hash_map::Entry, HashMap, HashSet}; +use crate::utils::hashmap::HashMap; +use std::collections::{hash_map::Entry, HashSet}; #[cfg(feature = "wavefront")] use std::path::PathBuf; @@ -163,7 +164,7 @@ pub fn intersect_meshes_with_tolerances( // 4: Initialize a new mesh by inserting points into a set. Duplicate points should // hash to the same index. let mut point_set = RTree::::new(); - let mut topology_indices = HashMap::new(); + let mut topology_indices = HashMap::default(); { let mut insert_point = |position: Point3| { insert_into_set(