Comment 16 for bug 1118663

Revision history for this message
Alvin Penner (apenner) wrote :

I have taken a quick look at the code in the new function divideCurves. If I understand it correctly, then it will produce a sequence of line segments each of whom has essentially the same length. I would strongly recommend against the use of a procedure like this. First of all it is incompatible with what was previously used. Secondly it is inefficient. It will generate too many unnecessary segments in areas where the curvature is low, such as linear segments. And it will generate too few segments in areas of high curvature where a small spacing is needed.
    What is needed is a routine that puts an upper limit on the allowable perpendicular deviation between the approximated line segment and the original curve. This is precisely what the original function cspsubdiv does. It calls the routine ffgeom.distanceToPoint which calls ffgeom.perpDistanceToPoint which calculates the perpendicular distance between the arc and the line using the Bezier control arms as approxinations. I have not gone through the mathematical derivation in detail but I believe this is the intent of this routine. In this context, then, the parameter 'flat' is defined as the upper limit on the allwable deviation between the arc and the line, as expected.