Fix T56074: Remove doubles creates holes

Own regression when moving remove-doubles to kd-tree
(seems to happen only in rare cases).
This commit is contained in:
Campbell Barton 2018-07-27 10:51:42 +10:00
parent d6e769d32e
commit 71564debf9
Notes: blender-bot 2023-02-14 09:17:57 +01:00
Referenced by issue #56074, Remove Doubles produces holes in mesh
1 changed files with 10 additions and 0 deletions

View File

@ -774,7 +774,12 @@ int BLI_kdtree_calc_duplicates_fast(
if (ELEM(duplicates[index], -1, index)) {
p.search = index;
copy_v3_v3(p.search_co, tree->nodes[node_index].co);
int found_prev = found;
deduplicate_recursive(&p, tree->root);
if (found != found_prev) {
/* Prevent chains of doubles. */
duplicates[index] = index;
}
}
}
MEM_freeN(order);
@ -786,7 +791,12 @@ int BLI_kdtree_calc_duplicates_fast(
if (ELEM(duplicates[index], -1, index)) {
p.search = index;
copy_v3_v3(p.search_co, tree->nodes[node_index].co);
int found_prev = found;
deduplicate_recursive(&p, tree->root);
if (found != found_prev) {
/* Prevent chains of doubles. */
duplicates[index] = index;
}
}
}
}