From d107f870472175854b28ac774a3eda1b35e2c6da Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Fri, 15 Nov 2024 18:18:28 +0100 Subject: [PATCH] fix enhanced-determinism compilation (#287) --- CHANGELOG.md | 11 +++++++++-- .../mesh_intersection/mesh_intersection.rs | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9ef3e3..3ab347ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +### Fix + +- Fix compiling with `enhanced-determinism` feature enabled. + - This is now checked on CI. + +## v0.17.2 + ### Added - Implement `::to_trimesh` in 2d for `Cuboid` and `Aabb`. @@ -21,9 +28,9 @@ - Removed `IntersectionCompositeShapeShapeBestFirstVisitor` (which had been deprecated for a while): use `IntersectionCompositeShapeShapeVisitor` instead. -### Fixed +### Fix -- Fixed some robustness issues in mesh/mesh intersection when parts of both meshes overlap perfectly. +- Fix some robustness issues in mesh/mesh intersection when parts of both meshes overlap perfectly. - Improve robustness of convex polygons intersections when all the vertices of one polygon are located in either the edges or vertices of the other polygon. - Fix incorrect orientation sometimes given to the polygon output by the convex polygon intersections when one of the diff --git a/src/transformation/mesh_intersection/mesh_intersection.rs b/src/transformation/mesh_intersection/mesh_intersection.rs index b12db52a..0170efbf 100644 --- a/src/transformation/mesh_intersection/mesh_intersection.rs +++ b/src/transformation/mesh_intersection/mesh_intersection.rs @@ -4,12 +4,13 @@ use crate::query::point::point_query::PointQueryWithLocation; use crate::query::{visitors::BoundingVolumeIntersectionsSimultaneousVisitor, PointQuery}; use crate::shape::{TriMesh, Triangle}; use crate::utils; +use crate::utils::hashmap::Entry; use crate::utils::hashmap::HashMap; use na::{Point3, Vector3}; use rstar::RTree; use spade::{ConstrainedDelaunayTriangulation, InsertionError, Triangulation as _}; use std::collections::BTreeMap; -use std::collections::{hash_map::Entry, HashSet}; +use std::collections::HashSet; #[cfg(feature = "wavefront")] use std::path::PathBuf; @@ -705,6 +706,9 @@ fn merge_triangle_sets( // If we are inserting two identical triangles but with mismatching // orientations, we can just ignore both because they cover a degenerate // 2D plane. + #[cfg(feature = "enhanced-determinism")] + let _ = e.swap_remove(); + #[cfg(not(feature = "enhanced-determinism"))] let _ = e.remove(); } }