Skip to content

Commit

Permalink
feat: ensure mesh/mesh intersection produces deterministic index-buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Nov 28, 2024
1 parent a3f5e19 commit dad61d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/shape/trimesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {crate::shape::Cuboid, crate::utils::SortedPair, na::Unit};
use {
crate::shape::composite_shape::SimdCompositeShape,
crate::utils::hashmap::{Entry, HashMap},
std::collections::HashSet,
crate::utils::hashset::HashSet,
};

#[cfg(feature = "dim2")]
Expand Down Expand Up @@ -542,7 +542,7 @@ impl TriMesh {
let mut vtx_to_id = HashMap::default();
let mut new_vertices = Vec::with_capacity(self.vertices.len());
let mut new_indices = Vec::with_capacity(self.indices.len());
let mut triangle_set = HashSet::new();
let mut triangle_set = HashSet::default();

fn resolve_coord_id(
coord: &Point<Real>,
Expand Down Expand Up @@ -693,7 +693,7 @@ impl TriMesh {
}

fn delete_bad_topology_triangles(&mut self) {
let mut half_edge_set = HashSet::new();
let mut half_edge_set = HashSet::default();
let mut deleted_any = false;

// First, create three half-edges for each face.
Expand Down
2 changes: 1 addition & 1 deletion src/transformation/mesh_intersection/mesh_intersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use na::{Point3, Vector3};
use rstar::RTree;
use spade::{ConstrainedDelaunayTriangulation, InsertionError, Triangulation as _};
use std::collections::BTreeMap;
use std::collections::HashSet;
use crate::utils::hashset::HashSet;
#[cfg(feature = "wavefront")]
use std::path::PathBuf;

Expand Down

0 comments on commit dad61d2

Please sign in to comment.