Splines as arcs
planex2d computes with splines through a chain of arcs, with lines where the curve is straight. approximation=True exports that chain instead of the B-spline, for tools that accept only lines and arcs. Figure 1 shows a spline through four marked points and a magnified piece of it with the joints of the chain that planex2d computes with:
[1]:
import planex as px
curve = px.Spline([(0, 0), (1, 0.6), (2, 0), (3, 0.8)])
chain = curve.edges[0].edge.approximation
print(len(curve.ToOCCWire().edges), "edge,", len(curve.ToOCCWire(approximation=True).edges), "with approximation=True")
1 edge, 142 with approximation=True
(a) A spline
(b) Magnified: joints of its 142 pieces
[4]:
print(sorted({type(e).__name__ for e in chain}), len(chain), "pieces")
['ArcEdge', 'LineEdge'] 142 pieces