Download presentation
Presentation is loading. Please wait.
1
Algorithm for Approximating Piecewise Smooth Curves
2
Polygonal approximation There are two types of methods associated with the polygon approximation problem: bounded-# : An upper bound for the number of vertices of the output polygonal line is demanded. bounded- : An upper bound for the approximation error is given. Depending on the accuracy of their solution polygonal approximation algorithms can by divided in optimal and sub- optimal methods. For approximating piecewise smooth curves we used a modification of the Douglas–Peucker algorithm, a sub-optimal bounded- method.
3
Douglas-Peucker algorithm Basic idea: recursive split Input: Set of successive points {P 1,...,P N } defining the input curve Algorithm: Approximate the current curve portion with the segment linking its end points. Compute the approximation error between the current curve and its approximating segment. Find the splitpoint. If the approximation error is greater then the threshold, split the curve portion at the splitpoint in two subcurves. Repeat steps 1-2 for the subcurves. Output: Set of successive points {P 1,...,P M } defining the output curve, with M ≤ N. P1P1 PNPN splitpoint
4
Recursive split for piecewise smooth curves Basic idea: same as before Input: Set of successive smooth curve pieces defining the input curve Algorithm: Approximate the current curve portion with the segment linking its end points. Compute the approximation error between each piece of the current curve and the approximating line (find_farthest). Find the splitpoint by determining the piece of the curve with the farthest point regarding the approximating line. If the approximation error is greater then the threshold, split the curve portion at the splitpoint in two subcurves. Repeat steps 1-2 for the subcurves. Output: Set of successive points defining the output curve. splitpoint
5
Operation Find Farthest The operation find_farthest is a member function of each object- class of the curve. It determines for every object the point with the overall maximum distance to a given line L. template typename R::FT find_farthest ( Object &object, const Line_2 &line, Point_2 &point) { return object.find_farthest(object,line,point); }
6
Find Farthest – Circular Arcs I For circular arcs are up to four candidate points for the farthest point: the two endpoints of the arc: source and target the two intersection points of the circle C and a perpendicular line to L through the center of C. 2. intersection point line L arc A source target 1. intersection point circle C
7
Find Farthest – Circular Arcs II To determine the farthest point you need to look at three distinct cases: 1. The intersection points are both not on the arc: source or target must be the farthest point. line L arc A source target 1. intersection point 2. intersection point
8
Find Farthest – Circular Arcs III 2. One intersection point is on the arc: this intersection point or source or target is farthest point. 1. intersection point line L arc A source target 2. intersection point
9
Find Farthest – Circular Arcs IV 3. Both intersection points are on the arc: one of them is farthest point. line L arc A source target 1. intersection point 2. intersection point
10
Find Farthest – Bézier Curves I For a Bézier curve of degree d with d+1 control points we used the following heuristic to approximate the farthest point: 1.Compute the distance of the control points to the approximating line L. 2.If the first or last control point has the overall maximum distance to L, the farthest point is found. 3.If the overall maximum is found at the i-th control point, 0<i<d, the curve is subdivided. 4.Proceed recursively with the subcurve which includes the control point with overall maximum distance to L.
11
Find Farthest – Bézier Curves II For the subdivision of a Bézier curve b(t), t [a,b], of degree d, we analyze two approaches: 1. The curve b(t) is always subdivided in the middle: t s =(a+b)/2. 2. The curve b(t) is subdivided at t s =a+((b-a)*i/d), with i the index of the control point with the maximum distance to the approximating line.
12
Split For piecewise smooth curves there are two possibilities for each split: The splitpoint is an endpoint of one of the current pieces. The list of pieces is split at the splitpoint. The splitpoint is a point in the interior of one of the pieces. The piece itself is split. A new piece has to be inserted in the list of pieces. line L arc A arc B line L source arc A target splitpoint
13
Operation Split The operation split is a member function of each object-class of the curve. It splits the piece of the curve containing the splitpoint into two pieces. template void split(Object &object,const Point_2 &splitpoint,const Iterator p, List &list) { Object* nobject; nobject = object.split(object,splitpoint); //Call split function of the object list.insert(p,nobject); //insert the pointer of the new object in the list }
14
Self-approximation If there is just one curve piece to approximate check if this curve object has an own approximation operation if so use this operation (selfapprox ) to approximate if not keep up with the pattern The operation selfapprox is a member function of each object- class of the curve. int d = distance(first,last); if (d==1) { if ((**first).has_self_approx()) (**first).selfapprox(); }
15
Example Error bound: 1
16
Example Error bound : 0. 000 000 1
17
Example Error bound: 10
18
Work in progress A traits class for distance measurements: Which distance measurements make sense and can be implemented efficiently? Integrate Bézier curves and B-Splines : Computing the farthest point for Bézier curves, how many recursive steps are necessary? How to compute efficiently the farthest point for B-Splines? Can we use geometric filtering, e.g., bounding boxes, upper and lower envelopes?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.