Skip to content

Commit fb5e2d7

Browse files
committed
Resolve #2487 - Auto subset size in grooming should pick a smart auto
auto (-1) defaults to a subset of 30 to avoid O(n^2) pairwise ICP on large datasets
1 parent fe24f96 commit fb5e2d7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Libs/Groom/Groom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ bool Groom::run_alignment() {
560560
bool any_alignment = false;
561561

562562
int reference_index = -1;
563-
int subset_size = -1;
563+
int subset_size = base_params.get_alignment_subset_size();
564564

565565
// per-domain alignment
566566
for (size_t domain = 0; domain < num_domains; domain++) {

Libs/Mesh/MeshUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ PhysicalRegion MeshUtils::boundingBox(const std::vector<Mesh>& meshes, bool cent
182182
}
183183

184184
int MeshUtils::findReferenceMesh(std::vector<Mesh>& meshes, int random_subset_size) {
185+
// auto (-1) defaults to a subset of 30 to avoid O(n^2) pairwise ICP on large datasets
186+
if (random_subset_size < 0) {
187+
random_subset_size = 30;
188+
}
185189
bool use_random_subset = random_subset_size > 0 && random_subset_size < meshes.size();
186190
int num_meshes = use_random_subset ? random_subset_size : meshes.size();
187191

0 commit comments

Comments
 (0)