On Jul 13, 2012, at 10:16 PM, crdueck wrote: > I'd like some feedback on the new functions, in particular > bezier_inflection() and approx_bezier(), which both use an iterative > method to walk the curve.
What sort of feedback? Coding-wise, there's a ton of functions in there that need to be labeled as HIDDEN (static) so as to not explode librt API. The calculation of the inflection point and the recursive subdivision are rather flimsy given the fixed step size. That'll likely be a problem for high-curvature / complex bezier curves, but it's certainly acceptable as a first solution. You'd probably want to adaptively step based on the local derivative. > currently, bezier_inflection() returns the first point where the > curvature vector evaluated at that point has greater magnitude than the > curvature vector evaluated one half interval forwards, which doesn't > seem very elegant or precise. Is there a better way to find a point of > inflection on the curve? good question. :) > similarly, approx_bezier() walks the curve in intervals, and computes > the minimum distance from the approximating circular arc to the bezier > curve evaluated at the interval. Is there a better way to determine when > the two curves diverge by more than a given tolerance? Other than the fixed interval size, that sounds like a pretty good solution to me. You might want to calculate *below* the distance tolerance instead of halting at/near it. You could either add an EQUAL() test or even use something like half the distance tolerance. Cheers! Sean ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel