Returns the list of vertices that should remain in the given mesh after keeping only the given cells
(mesh: &MeshT, cell_indices: &[usize])
| 373 | |
| 374 | /// Returns the list of vertices that should remain in the given mesh after keeping only the given cells |
| 375 | fn vertex_keep_table<R: Real, MeshT: Mesh3d<R>>(mesh: &MeshT, cell_indices: &[usize]) -> Vec<bool> { |
| 376 | let vertices = mesh.vertices(); |
| 377 | let cells = mesh.cells(); |
| 378 | |
| 379 | // Each entry is true if this vertex should be kept, false otherwise |
| 380 | |
| 381 | { |
| 382 | let mut table = vec![false; vertices.len()]; |
| 383 | for cell in cell_indices.iter().copied().map(|c_i| &cells[c_i]) { |
| 384 | for &vertex_index in cell.vertices() { |
| 385 | table[vertex_index] = true; |
| 386 | } |
| 387 | } |
| 388 | table |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | /// Returns a new mesh keeping only the given cells and vertices in the mesh |
| 393 | fn keep_cells_impl<R: Real, MeshT: Mesh3d<R>>( |
no test coverage detected