Skip to content

Commit a81a139

Browse files
committed
Stop with error when --check-mesh fails
1 parent fdcf969 commit a81a139

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

splashsurf/src/reconstruction.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use anyhow::{anyhow, Context};
33
use arguments::{
44
ReconstructionRunnerArgs, ReconstructionRunnerPathCollection, ReconstructionRunnerPaths,
55
};
6-
use log::{error, info};
6+
use log::info;
77
use rayon::prelude::*;
88
use splashsurf_lib::coarse_prof::profile;
99
use splashsurf_lib::mesh::PointCloud3d;
@@ -544,14 +544,6 @@ pub(crate) fn reconstruction_pipeline_generic<I: Index, R: Real>(
544544
let grid = reconstruction.grid();
545545
let mesh = reconstruction.mesh();
546546

547-
if check_mesh {
548-
if let Err(err) = splashsurf_lib::marching_cubes::check_mesh_consistency(grid, mesh) {
549-
error!("{}", err);
550-
} else {
551-
info!("Checked mesh for problems (holes, etc.), no problems were found.");
552-
}
553-
}
554-
555547
// Store the surface mesh
556548
{
557549
profile!("write surface mesh to file");
@@ -640,5 +632,13 @@ pub(crate) fn reconstruction_pipeline_generic<I: Index, R: Real>(
640632
info!("Done.");
641633
}
642634

635+
if check_mesh {
636+
if let Err(err) = splashsurf_lib::marching_cubes::check_mesh_consistency(grid, mesh) {
637+
return Err(anyhow!("{}", err));
638+
} else {
639+
info!("Checked mesh for problems (holes, etc.), no problems were found.");
640+
}
641+
}
642+
643643
Ok(())
644644
}

0 commit comments

Comments
 (0)