True biarcs

I posted some earlier work on arc approximation of splines, but those were not true biarcs. Tonight I did the true biarc implementation, this time in Python. I hope that I'll find time to drop this into emc 2.2 to provide a cubic bezier primitive, but the issue of beziers which move in more than two axes needs to be tackled before that can be done.

A biarc consists of two arcs which are tangent where they meet. By defining the initial and final locations, and the initial and final tangents, you're one number short of determining a unique biarc. The remaining parameter "r" (or α/β) determines where the split is between the first and second arc.


A great many of the papers on curve fitting with biarcs seem to be concerned with how to choose the remaining parameter to minimize error. However, based on the figures in the paper "Optimal Single Biarc Fitting and its Applications", it looks like the simple method "r=1" may be best suited to emc's trajectory planner: emc begins to behave poorly as segments get shorter. "r=1" appears to generate biarcs with similar average length, while the "Optimal" method proposed in that paper generates biarcs of wildly varying length.

The results from this program mirror those of my earlier arc-to-bezier fitting program: With even a small number of arcs, the fit becomes very good.


I completed the spline shown above into a closed loop with C1 continuity at the joins. The velocity profile (which includes 3 runs with different numbers of biarcs) is quite good, which shows the pleasing results the emc trajectory planner has as long as acceleration is reasonable and the primitives are not too short.

Updated 2007/11/23: I updated the image to show EMC 2.2's even better velocity profile. I updated biarc.py to have GPL copyright block.

Updated 2007/12/18: I found this paper helpful in understanding the biarc math. I only read the paper as far as Fig 1 and the associated math, ignoring most of the rest.

Files currently attached to this page:

biarc-spline-small.png26.0kB
biarc-spline.png6.8kB
biarc.py5.0kB
spline-velocity-profile-emc2.2-medium.png179.7kB
spline-velocity-profile-emc2.2-small.png85.7kB
spline-velocity-profile-emc2.2.png23.1kB
spline-velocity-profile-small.png81.0kB
spline-velocity-profile.png24.0kB
spline-velocity-profile2-small.png81.3kB
spline-velocity-profile2.png20.0kB
true-biarcs-small.png34.2kB
true-biarcs.png8.1kB


(originally posted on the AXIS blog)

Entry first conceived on 18 February 2007, 3:06 UTC, last modified on 15 January 2012, 3:46 UTC
Website Copyright © 2004-2024 Jeff Epler