Now there's the real problem. I even asked a question related to this on
math.stackexchange, as it was driving me crazy. Essentially the problem
is that curves with zero-length handles do tend to have infinite
curvature at the endpoint(s) with a zero-length handle, but the
curvature grows very quickly over a very short length of the segment. So
visually, you hardly see
anything. Put differently, the slope has a
non-zero derivative at the endpoint, while the norm of the derivative is
zero, so the slope changes by some finite amount over an infinitesimally
small length, leading to infinite curvature, but a finite (and typically
quite small) change in slope.
So essentially you have the extremely weird situation where a slope that
looks very smooth and (almost) straight, can actually have infinite
curvature at its endpoints (I think in principle this can also happen
elsewhere, but that's less of a problem in this context).
The problem with taking an approximation of the path is that I'm not
entirely sure how "stable" this is. So would taking a slightly different
approximation give you a completely different curvature, or is there
some "natural" curvature that can be defined? In fact, I've just tried
fitting a quadratic curve through the first 1/3 of a B?zier curve with
a
zero-length handle (at the first node), and I can get a huge range of
curvatures, without a big difference in fitting quality.
Of course this can always be "solved" by simply prescribing an
approximation method. One thing you could try is to basically take a
finite difference approximation to the curvature over a predefined range
of the curve (if the SVG spec would do something like this, the range
would probably have to be specified in the spec). For example, take the
angle of the curve at t=0 and t=1/3, take the difference and divide by
the arc-length. You could experiment with the range, or even try to do a
"higher order" approximation. I'm not entirely sure what this would
accomplish though.