[Math] algorithm for splitting splines into arc and line

algorithmsgeometryinterpolationspline

I would like to split splines of DXF files to lines and arcs in 2D for a graphic editor. From DXF file, I have extracted the following data:

  • degree of spline curve
  • number of knots and knot vectors
  • number of control points and their coordinates
  • number of fit points and their coordinates

Using the extracted data,

  • start and end point of lines
  • start and end point, center point, radius of arcs are needed to find.

I get confused which control points are controlling which knots by seeing the extracted data.
I have found this paper about biarc curve fitting. Is it only for only two connected arc or useful for splines with so many knot points? But, it still needs tangents to calculate the points of arc. Which algorithms should I use to find the points of arcs and lines?

Best Answer

See this question.

The answers include several useful links.

One of the links provides a very detailed explanation, plus C++ code for biarc approximation.