diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-04 07:37:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-04 07:39:41 +0300 |
commit | d3b85af6ca4b0d1cbddec99b5c53b6aa081af230 (patch) | |
tree | 6aa056c52180628602fb56c06af1c46e74fe9404 /source | |
parent | 293cc70e4f35180277d99ad4e23e762c3804d393 (diff) |
Fix T49850: Detailed curves are heavily reduced
Divide the threshold by the resolution to prevent duplicates
being detected in high resolution curves.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 1eb374d1a08..b2ebb56d828 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2992,6 +2992,8 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render) bl = bev->first; while (bl) { if (bl->nr) { /* null bevel items come from single points */ + /* Scale the threshold so high resolution shapes don't get over reduced, see: T49850. */ + const float threshold_resolu = 0.00001f / resolu; bool is_cyclic = bl->poly != -1; nr = bl->nr; if (is_cyclic) { @@ -3012,13 +3014,9 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render) } } else { - if (fabsf(bevp0->vec[0] - bevp1->vec[0]) < 0.00001f) { - if (fabsf(bevp0->vec[1] - bevp1->vec[1]) < 0.00001f) { - if (fabsf(bevp0->vec[2] - bevp1->vec[2]) < 0.00001f) { - bevp0->dupe_tag = true; - bl->dupe_nr++; - } - } + if (compare_v3v3(bevp0->vec, bevp1->vec, threshold_resolu)) { + bevp0->dupe_tag = true; + bl->dupe_nr++; } } bevp0 = bevp1; |