You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error_string += &format!("\n\tTriangle {}, boundary edge {:?} is located in cell with {:?} with center coordinates {:?} and edge length {}.", tri_idx, edge, cell_index, cell_center, grid.cell_size());
210
+
}else{
211
+
error_string += &format!(
212
+
"\n\tCannot get cell index for boundary edge {:?} of triangle {}",
213
+
edge, tri_idx
214
+
);
215
+
}
216
+
}
217
+
218
+
Err(error_string)
219
+
}
220
+
221
+
/// Same as [`check_mesh_consistency`] but also adds debug information taken from the marching cubes input
222
+
#[allow(unused)]
223
+
fncheck_mesh_with_cell_data<I:Index,R:Real>(
224
+
grid:&UniformGrid<I,R>,
225
+
marching_cubes_data:&MarchingCubesInput<I>,
226
+
mesh:&TriMesh3d<R>,
227
+
) -> Result<(),String>{
228
+
let boundary_edges = mesh.find_boundary_edges();
229
+
230
+
if boundary_edges.is_empty(){
231
+
returnOk(());
232
+
}
233
+
234
+
letmut error_string = String::new();
235
+
error_string += &format!("Mesh is not closed. It has {} boundary edges (edges that are connected to only one triangle):", boundary_edges.len());
236
+
for(edge, tri_idx, _)in boundary_edges {
237
+
let v0 = mesh.vertices[edge[0]];
238
+
let v1 = mesh.vertices[edge[1]];
239
+
let center = (v0 + v1) / (R::one() + R::one());
240
+
let cell = grid.enclosing_cell(¢er);
241
+
ifletSome(cell_index) = grid.get_cell(cell){
242
+
let point_index = grid
243
+
.get_point(*cell_index.index())
244
+
.expect("Unable to get point index of cell");
245
+
let cell_center = grid.point_coordinates(&point_index)
error_string += &format!("\n\tTriangle {}, boundary edge {:?} is located in cell with {:?} with center coordinates {:?} and edge length {}. {:?}", tri_idx, edge, cell_index, cell_center, grid.cell_size(), cell_data);
254
+
}else{
255
+
error_string += &format!(
256
+
"\n\tCannot get cell index for boundary edge {:?} of triangle {}",
0 commit comments