Hi,

I have noticed a few parts in lib2geom that give unstable output. I am trying to figure out what causes this and possible how to fix it:


In lib2geom’s toy example curvature-test.cpp, we fit osculating circle at a point of a given curve. We can slide along time parameter to fit osculating circle at different point on the curve. I modify the code a little to output the curvature plot of the curve in two ways:

1) Using D2<SBasis> to build curvature graph. Each segment in D2<SBasis> is a copy of SBasis from curvature curve K, offset by a constant. (as seen in RED).
Piecewise<SBasis> K = curvature(B);
2) Draw the graph directly by cairo_move_to(), cairo_line_to(). (as seen in GREEN).

The normal result would look like this: