Piecewise curvilinear approximation of planar curves is a useful technique in many engineering applications. The general goal is to represent a curve by a sequence of circular arcs and straight-line segments, within a given tolerance. The advantage of such an approximation is that it allows a curve to be represented by a (typically) comparatively small number of arcs and line segments, thus achieving a noise reduction and data compression.
From a practical point of view, it is particularly desirable to achieve tangent-continuous approximations: NC machining as well as rapid prototyping benefit from the availability of so-called G1 curves. In particular, high-speed machining greatly depends on smooth tool paths.
As part of Eibl's diploma (MSc) thesis, Johannes Eibl and Martin Held worked on the approximation of polygonal curves by biarc curves. Given a simple (planar) polygon, our biarc approximation algorithm finds a tangent-continuous approximation curve A that consists of biarcs (and straight-line segments). The approximation curve A is required to lie within a specified tolerance zone relative to P, thus guaranteeing a bounded maximum deviation of A from P. If requested by the user, the algorithm can also guarantee that P lies in a tolerance zone relative to A.
We studied both symmetric and asymmetric tolerance zones. In particular, the tolerance zone may lie completely at one side of P, e.g., in the interior of P. Dealing with asymmetric or one-sided tolerances is of importance for applications which do not tolerate approximation errors on both sides of P. For instance, in NC machining it is often preferred to drive the tool such that any approximation error results in under-cutting rather than in over-cutting.
Our approximation algorithm also guarantees the approximation curve A to be simple. In particular, the algorithm shrinks the tolerance appropriately at constrictions of P. Thus, the approximation curve A does not contain any self-intersections, and is globally valid.
More recently, Martin Heimlich and I designed a second approximation algorithm that relies on the Voronoi diagram of the input for computing (what we call) tolerance bands as subsets of the tolerance zones. We also added support for additional approximation primitives: our new algorithm can approximate sets of closed simple polygons by straight-line segments, circular biarcs, elliptic arcs, elliptic biarcs, and cubic Bezier curves. (That is, this algorithm can also be used for transforming an N-vertex polygon into an M-vertex polygon such that N<<M and approximation tolerances are met.) Of course, also our new algorithm maintains the topology of the input and can handle asymmetric or even one-sided tolerances.
Extensive experiments with synthetic and real-world data sets show that this new algorithm generates approximation curves with significantly fewer approximation primitives than previously proposed algorithms, including the t-part based approach of Eibl and myself. This difference becomes the more prominent the larger the tolerance threshold is or the more severe the noise in the input is. In particular, no heuristic is needed for smoothing noisy input prior to the actual approximation. Rather, our approximation algorithm can be used to smooth out noise in a reliable manner.
Our new Voronoi-based approximation and the t-part based approximation were implemented in ANSI C++ by Martin Heimlich and named PowerApx. (PowerApx makes use of my code VRONI for computing Voronoi diagrams.)
The source code for PowerApx is available for both academic and commercial use. Send me an email and I will let you know the details of how you could use our code. However, in order to avoid any disappointment, let me warn you upfront that PowerApx has not been released into the public domain!
Work on this project was supported by the Austrian Science Foundation (FWF) within FWF Project L43-N12.
M. Held (2007):
"Biarc Approximation, Simplification and Smoothing of Polygonal Curves by Means of Voronoi-based Tolerance Bands".
Int. J. of Computational Geometry and Applications, 18(3):221--250, June 2008.
M. Held, J. Eibl (2005):
"Biarc Approximation of Polygons Within Asymmetric Tolerance Bands".
Computer-Aided Design, 37(4): 357--371, April 2005.
J. Eibl, M. Held (2002):
"On a Simple Algorithm for Approximating Polygons by Biarc Curves Within Asymmetric Tolerance Bands".
SoCGMA'02, Vienna, Austria.
Our biarc approximation code was tested on hundreds of synthetic and real-world data sets. The following images show biarc approximations which were computed by means of our code. (Click on an image icon in order to see the full-size image. The full-size images have roughly 800x800 pixels.)
|Symmetric biarc approximation of a polygon: the image on the left shows the input polygon (in green) and the symmetric tolerance band (in white) for an approximation tolerance of roughly 0.1 units, and the image on the right shows the biarc approximation computed.|
|Asymmetric biarc approximation of a polygon: the image on the left shows the input polygon (in green) and the asymmetric tolerance band (in white) for an approximation tolerance of roughly 0.01 units, and the image on the right shows the biarc approximation computed.|
|One-sided biarc approximation of an "ellipse" polygon: the image on the left shows the input polygon (in green) and the one-sided tolerance band (in white) for an approximation tolerance of roughly 0.1 units, and the image on the right shows the biarc approximation computed.|
|Symmetric biarc approximation of a 1024-gon: the image on the left shows the input polygon (in green) and the vertices of the input polygon (in magenta), and the image on the right shows the biarc approximation computed for an approximation tolerance of roughly 0.002 units.|
|Symmetric biarc approximation of a 32768-gon: the image on the left shows the input polygon (in green) and the vertices of the input polygon (in magenta), and the image on the right shows the biarc approximation computed for an approximation tolerance of roughly 0.00006 units.|
|Symmetric biarc approximation of a noisy polygonal model of a circle: the image on the left shows the input polygon (in green), and the image on the right shows the biarc approximation computed after polygonal smoothing of the data by the biarc code for two times; the tolerance band corresponding to the second smoothing is depicted in white. Note that the resulting biarc approximation still respects the user's approximation tolerance relative to the original input! (For visual purposes both the jaggedness and the approximation tolerance have been exaggerated compared to typical values that oocur for real-world data.)|
|Simultaneous symmetric biarc approximation of a three polygons: the image on the left shows the input polygon (in green) and the resulting tolerance bands (in white), and the image on the right shows the biarc approximation computed. Note that all three biarc curves are simple and do not intersect each other!|
file last modified: Thursday, 23-May-2013 15:58:13 CEST
Copyright © 2013 Martin Held. All rights reserved.