diff --git a/src/delaunay_core/cell.rs b/src/delaunay_core/cell.rs index 9e9eab8..773f0eb 100644 --- a/src/delaunay_core/cell.rs +++ b/src/delaunay_core/cell.rs @@ -1084,7 +1084,9 @@ mod tests { assert_eq!(facets.len(), 4); for facet in facets.iter() { - assert!(cell.facets().contains(facet)); + // assert!(cell.facets().contains(facet)); + let facet_vertices = facet.vertices(); + assert!(cell.facets().iter().any(|f| f.vertices() == facet_vertices)); } // Human readable output for cargo test -- --nocapture diff --git a/src/delaunay_core/triangulation_data_structure.rs b/src/delaunay_core/triangulation_data_structure.rs index ddff9fe..6a6ea9d 100644 --- a/src/delaunay_core/triangulation_data_structure.rs +++ b/src/delaunay_core/triangulation_data_structure.rs @@ -306,6 +306,12 @@ where self.cells .retain(|_, cell| !cell.contains_vertex_of(&supercell)); + // Need Vertex to implement Eq and Hash to use the following code + // let supercell_vertices: HashSet<_> = supercell.vertices.iter().collect(); + // self.cells.retain(|_, cell| { + // !cell.vertices.iter().any(|v| supercell_vertices.contains(v)) + // }); + Ok(self) }