
16 Drawing Parametric Curves Using Chebyshev Polynomials John Buchanan Aloin Fournier Department of Computer Science University of British Columbia Vancouver, British Columbia V6T lW5 {buchanan I fournier }@cs.ubc.ca Abstract General Terms: algorithms. Polynomial parametric curves are powerful and popular Additional Keywords and Phrases: Chebyshev polynomi­ modeling tools in Computer Graphics and Computer als, Linearity criteria, Adaptive curve drawing. Aided Design. There are two requirements that are placed on techniques for displaying these curves. In 1. Introduction interactive applications, such as drawing and design, the Polynomial parametric curves are powerful and popular need is for a fast display. In non interactive applica­ modeling tools in Computer Graphics and Computer tions, such as typeset ting, the need is for accuracy (or at Aided Design. A combination of hardware and algo­ least the appearance of accuracy). Most techniques rithmic advances have made it possible to draw hun­ address one or the other of these conflicting require­ dreds or thousands of these curves in real time on ments. modern graphics workstations. There are two require­ We propose and demonstrate the use of Chebyshev basis ments that are placed on techniques for displaying these functions for an adaptive curve drawing method which curves. In interactive applications the need is for a fast is both fast and accurate. The use of Chebyshev poly­ display, and this can be achieved by drawing long nomials provide us with an inexpensive linearity meas­ straight line segments, sacrificing the smoothness of the ure which is useful in an recursive algorithm. Further original curve. In non-interactive applications the need applications of this approach include efficient boxing is for accuracy. It is interesting to note that what and the generation of smooth filtered curves. matters is usually the appearance of accuracy. For example a curve with a visible discontinuity is normally Resume perceived as worse than a smooth curve, even though by Les courbes parametriques polynomiales constituent un some metric the curve with the discontinuity might be outil puissant et populaire pour la modelisation en better than the smooth curve. infographie et en conception assistee par ordinateur. Les Most curve drawing techniques address one or the other techniques d'affichage pour ces courbes doivent repondre of these conflicting requirements. We propose here a cl. deux exigences. Dans les applications interactives, technique which is adaptive but fast, and has the advan­ telles que le dessin et le design, l'affichage doit etre tres tage of offering a good "quality" criterion as part of the .rapide. Dans les applications non-interactives, telles que algorithm. la typographie digit ale, la precision (en tout cas l'apparence de la precision) est primordiale. La plupart 1.1. Current Methods des techniques sont concernees avec l'une ou l'autre de Since most of the display systems we work with ces exigences. currently are capable of drawing straight lines and set­ Nous proposons et nous illustrons I'utilisation des ting pixels, the task of drawing a parametric curve can polynomes de Tchebychev comme bases pour une tech­ be reduced to that of either drawing a straight line or nique adaptive de trace qui est et la fois rapide est setting pixels. So an obvious strategy is to subdivide a precise. L'utilisation des polynomes de Tchebychev curve until it can be satisfactorily represented by a suc­ nous fournit une mesure de linearite economique tres cession of straight line segments. There are many utile dans le cadre d'une methode recursive. D'autres methods for subdividing parametric curves but the applications de la meme approche incluent une mise en method of choice has been to perform a uniform subdivi­ boite efficace et la generation de courbes lissees et sion of the curve in the parameter t. The curve is given filtrees. as: CR Categories: 1.3.3 [Computer Graphics]: Q(t) = ( X(t), y(t) ) Picture/Image Generation 1.3.5 [Computer Graphics]: Computational Geometry and Object Modeling where X( t) and Y( t) are polynomials m t. Given a Graphics Interface '91 17 6; = t'+l-t;, one calculates the coordinates Q(tj) and a global, criterion for the span considered. Q(ti+i) and draw the line segment which connects them. The full cost of directly evaluating the curve poly­ 1.2. Geometric vs Parametric Straightness nomials can be avoided by using forward differencing There can be two criteria when evaluating the straight­ (see Foley & van Dam [Fole82] for a description of the ness of a parametric curve. The first one, which can be technique in this context). Since the forward differencing called geometric straightness, is related to the distance computations can be put in the form of a multiplication between the curve and some straight line segment by a 4x4 ma.trix in the case of cubic curves, in some approximation. This would be ideally something like the graphics systems hardware is used to speed up this pro­ minimum largest distance over the whole curve, or some cess. A major drawback of this method is tha.t there is value bounding it. The other one, parametric straight­ no obvious good heuristic for determining a correct ness, is related to the distance between a point on the value of 6. The selection of a small 6 can result in straight line segment and the point on the curve with excessive computation, the selection of a large 6 can the same parameter. Here again one might be interested result in a curve with a polygonal look (ie obvious in a minmax measure. It of course assumes a parametri­ discontinuities) and large "missing parts". zation of the line segment, and different parametriza­ Recursive subdivision is an old numerical method, and tions will give different results. One assumes here a uni­ Catmull [Catm75] used it in the context of the display form (ie linear) parametrization for the line segment. It of Bezier surfaces. Many other followed, and to mention is clear that the parametric straightness "contains" the a still popular method Lane, Carpenter, Whitted and geometric straightness, since the distance in the former Blinn [Lane80 ] showed how a curve could be recursively is always greater than or equal to the distance in the subdivided until each section of the curve could be ade­ latter. In this respect the distinction is similar to the quately approximated by a straight line segment. In difference between geometric and parametric continuity their method they used the Bernstein polynomial basis (where the latter implies the former) . While in most and used the convex hull property of the Bezier curves applications involving surfaces parametric values are to produce a measure of 'straightness'. Given a Bezier necessary, it is not obviously the case with curves. It curve defined by the control points Po, Pi, P 2 and P 3, could be the case that most curves used in practice are the straight line segment which approximates this curve not very far from an arc-length parametrization, in is the line from Po to P 3 and the error measure is which case the difference is not important. In curves defined by whichever of the points Pi, P 2 is furthest used for shape design there is no advantage, and some from the approximating line. The cost of calculating disadvantages, in using a very non-uniform parametriza­ this error measure at each level of subdivision is quite tion. Furthermore, if one uses a subdivision process (as high. we do) the non-aniformi ty decreases at each subdivision level. Adaptive forward differencing was a method introduced by Lien, Shantz, and Pratt [Prat87 , Chan88 , Rocc89] 1.3. Speed and Accuracy which attempted to bridge the gap between recursive In this paper we introduce the use of the Chebyshev subdivision and uniform subdivision. In this scheme the basis for subdivision and straightness control, and show Euclidean distance between the current point and the how these polynomials provide us with a good recursive next point is evaluated, if this distance is greater than a adaptive curve drawing method. The Chebyshev poly­ pixel the step size is halved and if the distance is smaller nomials provide an accurate and inexpensive error meas­ than a pixel it is doubled. The curves which are gen­ ure, and the subdivision of curves defined in this basis is erated using this method can be very accurate bu t the quite fast . We will present statistics on over a thousand method suffers from serious drawbacks. First the curves comparing our method to forward and adaptive unwary implementer may end up with an infinite loop forward differencing methods, showing our method to be as the method doubles and halves the next parametric faster for the same accuracy, or more accurate for the step in an effort to find a correct step, since the distance same speed. is not linearly related to the parametric step. A simple solution to this is to check for the undershoot first, then 2. Chebyshev Polynomials check for the overshoot, and accept the resulting step. This ensures that a step is always taken. A second and The basis polynomials used with parametric curves are more serious flaw is the possibility of omitting part of chosen primarily because they facilitate the design pro­ the curve, this can occur if a large initial value is cess, and additionally because they are easy to evaluate. selected for c. In Figure 1 we see a situation where a There is no reason to believe that the same formulation selection of 6=1 will result in a single pixel being ren­ will facilitate the display of the curve. Since the design dered, since the two end points of the curves are and the rendering are normally two separate phases, and geometrically the same.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-