diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-27 04:01:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-27 04:01:01 +0300 |
commit | b8ab2a84d3238fcefb67b903848696bee7b5daec (patch) | |
tree | c2e7276f3176584049022cc0d5333e9e2a800eb8 /source/blender/blenlib | |
parent | cf080657a1a5ad62121079f93e130ac10fcce18f (diff) | |
parent | 71564debf919d9ac99387359e9a07195bf0d94ff (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdtree.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index 700000b7717..80a2957d907 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -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; + } } } } |