Fix for #6686: crash with array modifier fit to curve option, could

create a too large amount of duplicates.
This commit is contained in:
2008-02-25 13:05:08 +00:00
parent d4fface140
commit 3dc8342945

View File

@@ -802,10 +802,10 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
|| amd->fit_type == MOD_ARR_FITCURVE) {
float dist = sqrt(MTC_dot3Float(offset[3], offset[3]));
if(dist > FLT_EPSILON)
if(dist > 1e-6f)
/* this gives length = first copy start to last copy end
add a tiny offset for floating point rounding errors */
count = (length + FLT_EPSILON) / dist;
count = (length + 1e-6f) / dist;
else
/* if the offset has no translation, just make one copy */
count = 1;