Skip to content

Commit

Permalink
fix: slight algorithmic improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
acgetchell committed Nov 10, 2024
1 parent c71b046 commit f43b3f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/delaunay_core/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/delaunay_core/triangulation_data_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit f43b3f4

Please sign in to comment.