|
2 | 2 | #include <GroomParameters.h> |
3 | 3 | #include <Image/Image.h> |
4 | 4 | #include <Logging.h> |
| 5 | +#include <Profiling.h> |
5 | 6 | #include <Mesh/Mesh.h> |
6 | 7 | #include <Mesh/MeshUtils.h> |
7 | 8 | #include <Optimize/Constraints/Constraints.h> |
@@ -32,6 +33,7 @@ Groom::Groom(ProjectHandle project) : project_{project} {} |
32 | 33 |
|
33 | 34 | //--------------------------------------------------------------------------- |
34 | 35 | bool Groom::run() { |
| 36 | + TIME_SCOPE("Groom::run"); |
35 | 37 | ShapeWorksUtils::setup_threads(); |
36 | 38 |
|
37 | 39 | used_names_.clear(); |
@@ -124,6 +126,7 @@ bool Groom::run() { |
124 | 126 |
|
125 | 127 | //--------------------------------------------------------------------------- |
126 | 128 | bool Groom::image_pipeline(std::shared_ptr<Subject> subject, size_t domain) { |
| 129 | + TIME_SCOPE("Groom::image_pipeline"); |
127 | 130 | // grab parameters |
128 | 131 | auto params = GroomParameters(project_, project_->get_domain_names()[domain]); |
129 | 132 |
|
@@ -321,6 +324,7 @@ bool Groom::run_image_pipeline(Image& image, GroomParameters params) { |
321 | 324 |
|
322 | 325 | //--------------------------------------------------------------------------- |
323 | 326 | bool Groom::mesh_pipeline(std::shared_ptr<Subject> subject, size_t domain) { |
| 327 | + TIME_SCOPE("Groom::mesh_pipeline"); |
324 | 328 | // grab parameters |
325 | 329 | auto params = GroomParameters(project_, project_->get_domain_names()[domain]); |
326 | 330 |
|
@@ -381,8 +385,10 @@ bool Groom::mesh_pipeline(std::shared_ptr<Subject> subject, size_t domain) { |
381 | 385 |
|
382 | 386 | //--------------------------------------------------------------------------- |
383 | 387 | bool Groom::run_mesh_pipeline(Mesh& mesh, GroomParameters params, const std::string& filename) { |
384 | | - // Repair mesh: triangulate, extract largest component, clean, fix non-manifold, remove zero-area triangles |
385 | | - mesh = Mesh(MeshUtils::repair_mesh(mesh.getVTKMesh())); |
| 388 | + // Repair mesh: triangulate, clean, fix non-manifold, remove zero-area triangles |
| 389 | + // Skip extract-largest-component for shared boundary domains to avoid removing fragments at the cut surface |
| 390 | + bool extract_largest = !params.is_shared_boundary_domain(); |
| 391 | + mesh = Mesh(MeshUtils::repair_mesh(mesh.getVTKMesh(), extract_largest)); |
386 | 392 |
|
387 | 393 | if (params.get_fill_mesh_holes_tool()) { |
388 | 394 | mesh.fillHoles(); |
@@ -557,6 +563,7 @@ bool Groom::get_aborted() { return abort_; } |
557 | 563 |
|
558 | 564 | //--------------------------------------------------------------------------- |
559 | 565 | bool Groom::run_alignment() { |
| 566 | + TIME_SCOPE("Groom::run_alignment"); |
560 | 567 | size_t num_domains = project_->get_number_of_domains_per_subject(); |
561 | 568 | SW_DEBUG("Running alignment, number of domains = {}", num_domains); |
562 | 569 | auto subjects = project_->get_subjects(); |
|
0 commit comments