||||||||||||III USOO540.8598A United States Patent (19) 11 Patent Number: 5,408,598 Pryor, Jr
Total Page:16
File Type:pdf, Size:1020Kb
||||||||||||III USOO540.8598A United States Patent (19) 11 Patent Number: 5,408,598 Pryor, Jr. 45 Date of Patent: Apr. 18, 1995 54 METHOD FOR FAST GENERATION OF 4,943,935 7/1990 Sate ..................................... 364/518 PARAMETRC CURVES EMPLOYNGA 4,949,281 8/1990 Hillenbrand et al. ... 364/518 CULA NUMB 4,999,789 3/1991 Fiasconaro .......................... 395/127 SEE SEREEE 5,133,052 7/1992 Bier et al. .......... ... 395/133 X 5,214,754 5/1993 Okamoto et al. ................... 395/142 DETERMINED ERROR THRESHOLD saw is is 75 Inventor: Duaine W. Pryor, Jr., Berkeley, OTHER PUBLICATIONS Calif. Computer Science Press, Inc., “Algorithms for Graph s ics and Image Processing', Theo Pavlidis Bell Labora 73 Assignee: tail Rte Mahines tories, pp. 221-231., 1982. is all y o a I. D. Faux et al., "Computational Geometry for Design 21 Appl. No.: 202,678 and Manufacture', Dept. of Mathematics 1979, pp. 127-145. Publisher: E. Horwood Ltd. 22 Fed:e Feb. 25, 1994 Wolfgang Dahmen, “Subdivision Algorithms Con verge Quadratically”, 1988, pp. 145-158, Journal of Related U.S. Application Data Computational and Applied Mathimatics. 63 Continuation of Ser. No. 705,041, May 23, 1991, aban- s doned. Primary Examiner-Almis R. Jankus 51 Int. Cl6 11/00 Attorney, Agent, or Firm-Perman & Green 52 U.S.C.. 395/2,39571.43 (57) ABSTRACT 58 Field of Search ................................ 395/141-143, A method enables the prediction of the number of sub 395/119, 123, 127, 133, -140, 155, 150, 151 divisions of a curve that will be required by control (56) References Cited polygons to assure that a resulting straight line repre sentation of the curve will not exceed a preset error U.S. PATENT DOCUMENTS threshold. The method is applicable to cubics and para 3,806,713 4/1974 Ryberg ........................... 235/151.11 metric quadratics including parabolas, ellipses and hy 4,648,024 3/1987 Kato et al. .......................... 364/169 perbolas. In each case, the prediction of the number of 4,654,805 3/1987 Shoup, II ............................ 364/520 subdivisions eliminates the need for a detailed error 4,760,5484,674,058 7/19886/1987 LindbloomBaker et al. et......................... al. ................ 364/518E. calculation at each subdivision8 step, thereby enabling an 4,855,935 8/1989 Lien et a 364/521 error calculation to be carried out only once in the 4,907,282 3/1990 Daly et al. .............................. 382/9 process. 4,912,659 3/1990 Liang .................................. 364/521 4,912,664 3/1990 Weiss et al. ..................... 395/123 X 14 Claims, 9 Drawing Sheets CUBC CURE APPROXAO 20 CREATE BEAERFOR CONTROLCRE POLYGO SET ACCEPTANCE ERROR = AE COPUTE ODIFIEDERROR as "m 24 DRAW LINE(S) FRO SUBDIVIDE POLYGON(S) BEGINNINGO ED EYNG TO POLYGONS FOR COORONATES OF EACH, i.e., EF AND RIGHT CONTROL POLYGONS) POYCOS U.S. Patent Apr. 18, 1995 Sheet 1 of 9 5,408,598 p2 mid p5 2 r3 POLYCON POLYCON U.S. Patent Apr. 18, 1995 Sheet 2 of 9 5,408,598 BEZIER SECOND ORDER CURVE (PARABOLA) (10) P0 FIG. 5 O. A. PERSPECIVE PROJECTION OF A 3-D PARABOLA TO A 2-D CONIC HREE-D PARABOLA s c VIEW POINT Y WEW PLANE FIG. 6 U.S. Patent Apr. 18, 1995 Sheet 3 of 9 5,408,598 11 15 12 14. MCRO EPROM RAM PROCESSOR 13 16 17 DISPLAY CONTROL F.C. 7 U.S. Patent Apr. 18, 1995 Sheet 4 of 9 5,408,598 CUBC CURVE APPROXMATION CREATE BEZER CONTROL POLYCON 20 FOR CURWE 22 SET ACCEPTANCE ERROR = AE COMPUTE MODIFIED ERROR = "m" 24 m c. DRAW LINE(S) FROM SUBDIVIDE POLYGON(S) BEGINNING TO END YELDING TWO POLYCONS FOR CORPIASE EACH, i. e., LEFT AND RIGHT |CONTROL POLYCONS) POLYCONS 28 30 COMPUTE m / 4 32 FG. 8 U.S. Patent Apr. 18, 1995 Sheet 5 of 9 5,408,598 CUBIC CURVE APPROXIMATION (ALTERNATE) CREATE BEZIER CONTROL POLYCON | FOR CURVE SET ACCEPTANCE ERROR = AE COMPUTE : = log ( v2 max (Ix"(0)|, |x"(1), y(0), YES DRAW LINE(S) FROM BEGINNING TO END SUBDIVIDE POLYCON(S) YELDING TWO POLYCONS FOR COORDINATES OF EACH, i. e., LEFT AND RIGHT CONTROL POLYCON(S) POLYCONS COMPUTE L - FIG. 9 U.S. Patent Apr. 18, 1995 Sheet 6 of 9 5,408,598 CONCS CURVE APPROXMATION CREATE BEZIER CONTROL POLYCON 40 SET MAXIMUM ERROR = AE 42 DENTIFY CURWE TYPE W() > W(O) = HYPERBOLA W). KWO) = EPSE W(1) = WO) = PARABOLA CALCULATE MODIFIED ERROR FOR DENTFED CURWE "ellipse E O=x,yTOX (s - 2a1 + q2 + 2 wo - Wilmax (a(t)) 2(wo- w) AE W - wo E FOX lanO - 2a1 +t q2u2 + 4 max(a(t))( w1 + wo (parabola)hyperbola dily ( - 4 AE - - - CONTINUE AT DECISION Y BOX 26 N FIG. 8 F.G. 10 U.S. Patent Apr. 18, 1995 Sheet 7 of 9 5,408,598 CONICS CURVE APPROXIMATION (ALTERNATE) CREATE BEZIER CONTROL POLYCON SET MAXIMUM ERROR = AE DENTIFY CURVE TYPE 1) > WO = HYPERBOLA W(1) { WO = ELLPSE W1) = W O = PARABOLA CALCULATE L = LOG4 m FOR IDENTIFIED CURVE WHERE n: ?usellipse E d'EyOX (i. - 2c + l2 + 2wo - will sen) 2(w + w)AE lan - 2a1 + qi + 4 max(a(t) "W -, W"O hyperbold 9 O t u2. w1 + wo w1 - wo yperDola driy 4A + 2 W + wo (parabola) E CONTINUE AT DECISION BOX IN FC, 9 F.C. 11 U.S. Patent Apr. 18, 1995 Sheet 8 of 9 5,408,598 NCREMENTAL ALCORTHM FOR CUBCS INPUT: BEZIER CUBIC POLYGON, SPECIFIED BY COORDINATEFUNCION : ERROR TOLERANCE = AE COMPUTE: (4.max (Ix"(0)|, |x"(1), y(0), ly(1)) 52 L = io94 — a CHOOSE STEP SIZE At = 2 154 COMPUTE 56 y(0), y(0), y(0), y t(0) TO A PRECISION AE(2) FOR (t = At TO 1, BY At INCREMENTS) COMPUTE: x(t) = x(t - At) + x(t - A t) x(t) = x(t- At) + x(t - A t) 58 Xt(t) e Xt(t - A t) + Xtt (t - At) y(t) = y(t - At) + y(t At) y(t) = y(t- At) + y tact At) y(t) = ytt (t - At) + ytt (t - At) DRAWx(t), y(t) LINE FOR FROM EACH x(t AtA?ia: INCREMENT - A t) TO FG, 12 U.S. Patent Apr. 18, 1995 Sheet 9 of 9 5,408,598 INCREMENTAL ALCORTHM FOR CONCS INPUTRATIONAL QUADRATIC AND ERROR TOLERANCE AE F: CONC = EPSE THEN: COMPUTE L = log 4 (mellipse) O IF: CONIC = HYPERBOLA, PARABOLA THEN: COMPUTE L = log 4 ("hyperbola ) CHOOSE STEP SIZE At = 2 64 COMPUTE: X(0), Xi(0), Xt(0) Y(0), Y(0), Y(0) 66 w(0), w (0), W(0) ALL TO A PRECISION AE(2) FOR (t = At TO 1, BY At INCREMENTS) COMPUTE: X(t) = X(t - At) + X(t-A t) X(t) = X(t - At) + Xt(t.-At) 68 Y(t) = Y( - At) + Y( - A ) Y(t) = Y(t - At) + Y( - A t) w(t) = w(t - At) + w(t - At) w(t) = wi(t- A t) + w(t - At) x(t) = X(t) / w(t) y(t) = Y(t) / w(t) DRAWx(t), y(t) LINE FOR FROM EACH x(t Atlike: INCREMENT - At)TO F.G. 13 5,408,598 1. 2 proximate the curve with errors no larger than AE. The METHOD FOR FAST GENERATION OF curve itself is described by a control polygon consisting PARAMETRC CURVES EMPLOYING A of 4 points, p1, p2, p3, p4. Such a control polygon is PRE-CALCULATED NUMBER OF LINE shown in FIG. 1 and which also includes cubic curve 10 SEGMENTS IN ACCORDANCE WITH A is being approximated. The dimension E is the error and DETERMINED ERROR THRESHOLD defines the distance between the chord p1-p4 and the apogee of curve 10. If E is greater than AE two more This is a continuation of application Ser. No. polygons are constructed from the original polygon, 07/705,041, filed on May 23, 1991, now abandoned. with the property that curve 10 lies within each new FIELD OF THE INVENTION O polygon, and that each new polygon is the control poly gon for the part of the curve which it contains. This This invention relates to computer graphics, and subdivision proceeds recursively. more precisely, to a method and apparatus for rapidly An iteration of this subdivision process has three generating curves on a computer display. stages. The first stage is indicated in FIG. 2 wherein the BACKGROUND OF THE INVENTION 5 following values are found: Computer graphics employ a number of techniques to reproduce curved lines and surfaces. One commonly used technique involves producing a set of points and connecting those points with straight lines to approxi 20 n = p 2 mate the curve. The curve is successively divided into smaller pieces and then checked to see if each piece can be approximated by a straight line to within a given mid = 2 P error threshold. It turns out that the check of the accu r4 = p4 racy of the approximation is the dominant part of the 25 cost of executing the curve approximation algorithm. r3 = p P3 In a two-dimensional space, a curve is often expressed 2 as a function of orthogonal components x and y, i.e., y is equal to f(x). In a three-dimensional coordinate sys The second stage of the calculation is shown in FIG. tem, the x, y and z coordinates may also be represented 3 and shows the derivation of points 13 and r2 as fol as functions of one or two of the orthogonal compo 30 lows: nents. However, these representations may cause diffi culty in generating the coordinate values.