Let's assume we have a planar domain whose boundary can be described with a polynomial curve (like Bezier curves). Now assume that you want to produce a discretization of the boundary, i.e. you want to produce a polygon by sampling the polynomial defining the boundary of the domain. How can I produce a boundary that incurs in a error lower than some user provided tolerance? A measure of the error could be something like.
$$ \sum_{\text{sides}}\int_0^1 ||\operatorname{line}(x_j,x_{j+1},t) - \partial\Omega_j(t)||^2 dt $$
That is, the square error of the polygon (whose sides are straight lines from vertex $x_i$ to $x_{i+1}$) with respect to the polynomial domain whose sides are represented by the parametrization $\partial\Omega_j(t)$. Each side is parametrized in the interval $t \in [0,1)$.
I am trying to improve the shape2polygon function of the GNU/Octave package geometry.
EDIT: The idea is to produce a polygonal representation of the original domain with the given error, with as few vertices as possible.
Thanks
EDIT:
- I have implemented an GNU/Octave non-recursive version of the Ramer-Douglas-Peucker algorithm to simplify polylines and polygons. simplifyPolyline_geometry.m and simplifyPolygon_geometry.m.
- I have implemented an GNU/Octave non-recursive version of the algorithm in L. H. de Figueiredo (1993). "Adaptive Sampling of Parametric Curves". Graphic Gems III. This function performs adaptive sampling of a parametrized planar curve. curve2polyline.m. The extension to polynomial domains is in shape2polygon.m.