Hi Alfred,
great news.
I digged a little bit in curve code to see the inner complexity of it and get scared :D
As you pointed out, this curve comes from a previous point interpolation to create a smooth path from few control points and now it gets back to lines for the movement.
I do undertand that coming from a previous interpolation, the curve description is quite controlled and it is great that it simplifies the "curve fitting".
About the quality of the approximation, I have seen some solutions that allow to define the number of segments per spline and usually move around 25 per spline, in the cnc world it is usually defined as number of points per cm, but I guess it could be the max delta angle between connected lines.
The good thing is that the output from jsxgraph is already optimized, so it is one step ahead of typical processing.
My 2 cents in possible solutions:
Most CAD solutions usually provide spline to polyline/polyline+arcs and the goal is really well described
here and in this
chart
There are several solutions for
this but they seem to summarized
here :
if fine control of error is desired, then biarc approximation
here well explained with interactive simulation and code
here , otherwise the
"four center" solution can do the job.
Not sure if any of those approaches are too far from possible straight forward solution already foreseen but looks pretty close to the linear approximation used by most CAD programs.