division by zero in ControlPolygonFlatEnough()
Open Source Solid Modeling CAD
Brought to you by:
brlcad
source file : bezier_2d_isect.c
function : ControlPolygonFlatEnough()
in case the first and last point of the bezier curve have the same Y:
a = V[0][Y] - V[degree][Y];
we have a division by zero:
a2 = a;
b2 = b;
c2 = c + max_distance_above;
det = a1 * b2 - a2 * b1;
dInv = 1.0/det;
being a1 always ZERO, det is != ZERO only if a2==a id different from ZERO.
Fixed in r59405. Thanks for the report!
i just happen to have downloaded version 7.24.2 and i noticed the problem is still there. Is it right?
7.24.2 is not our latest sources -- you can verify the fix by looking at sources in our subversion repository (the file is now src/librt/bezier.c and the function renamed).