diff options
-rw-r--r-- | source/blender/modifiers/intern/MOD_weld.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index 9c8579e1cd3..f96ec9a82e5 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1602,6 +1602,7 @@ static bool bvhtree_weld_overlap_cb(void *userdata, int index_a, int index_b, in struct WeldOverlapData *data = userdata; const MVert *mvert = data->mvert; const float dist_sq = len_squared_v3v3(mvert[index_a].co, mvert[index_b].co); + BLI_assert(dist_sq <= ((data->merge_dist_sq + FLT_EPSILON) * 3)); return dist_sq <= data->merge_dist_sq; } return false; @@ -1646,7 +1647,7 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex /* TODO: For a better performanse use KD-Tree. */ struct BVHTreeFromMesh treedata; BVHTree *bvhtree = bvhtree_from_mesh_verts_ex( - &treedata, mvert, totvert, false, v_mask, v_mask_act, wmd->merge_dist, 2, 6, 0, NULL); + &treedata, mvert, totvert, false, v_mask, v_mask_act, wmd->merge_dist / 2, 2, 6, 0, NULL); if (v_mask) { MEM_freeN(v_mask); |