Fix T49850: Detailed curves are heavily reduced

Divide the threshold by the resolution to prevent duplicates
being detected in high resolution curves.
This commit is contained in:
Campbell Barton 2020-11-04 15:37:37 +11:00
parent 293cc70e4f
commit d3b85af6ca
Notes: blender-bot 2023-05-31 04:43:10 +02:00
Referenced by issue #49850, Detailed Bezier Curves  get decimated with higher curve resolution
1 changed files with 5 additions and 7 deletions

View File

@ -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;