On Sun, Apr 27, 2014 at 09:03:32PM -0400, Papoj Thamjaroenporn wrote:
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:
- 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);
- Draw the graph directly by cairo_move_to(), cairo_line_to(). (as seen in GREEN).
The normal result would look like this:
However, when I hover my mouse around randomly (no input has been changed), the curve being fitted using D2<SBasis> will go wild randomly too:
Hi Papoj, I wonder if there is a bug in the code which up degrees quads to cubics, it looks like a sign error to me.
njh