[Commit] cairo ChangeLog,1.57,1.58 TODO,1.3,1.4

Carl Worth commit at keithp.com
Mon Sep 15 08:55:12 PDT 2003


Committed by: cworth

Update of /local/src/CVS/cairo
In directory home.keithp.com:/tmp/cvs-serv4984

Modified Files:
	ChangeLog TODO 
Log Message:
Fix for invalid restore from keithp.
Began adding notes on arc support.

Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/cairo/ChangeLog,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- ChangeLog	15 Sep 2003 14:29:44 -0000	1.57
+++ ChangeLog	15 Sep 2003 14:55:10 -0000	1.58
@@ -1,3 +1,9 @@
+2003-09-15  Carl Worth  <cworth at isi.edu>
+
+	* src/cairo.c (cairo_restore): Fix to catch invalid restore rather
+	than just catching the second invalid restore. Fix from Keith
+	Packard <keithp at keithp.com>.
+
 2003-09-12  Carl Worth  <cworth at east.isi.edu>
 
 	* src/cairo_surface.c (cairo_surface_create_similar_solid): Don't

Index: TODO
===================================================================
RCS file: /local/src/CVS/cairo/TODO,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TODO	12 Sep 2003 17:53:04 -0000	1.3
+++ TODO	15 Sep 2003 14:55:10 -0000	1.4
@@ -10,3 +10,49 @@
 compiled conditionally.
 
 * Verification, profiling, optimization.
+
+
+Some notes on arc support
+-------------------------
+
+"Approximation of circular arcs by cubic poynomials", Michael Goldapp,
+Computer Aided Geometric Design 8 (1991) 227-238.
+
+To draw a unit arc from 0 to A with 0 < A < pi/2:
+
+	Y
+	
+	|   .
+	|  /  .
+	| /    .
+	|/A    .
+	+------.-- X
+	0      1
+
+The deviation in radius is given by:
+
+	rho(t) = sqrt ( x^2(t) + y^2(t) ) - 1
+
+A simpler error function to work with is:
+
+	e(t) = x^2(t) + y^2(t) - 1
+
+And from Dokken[cite]: e(t) ~ 2 abs( rho(t) )
+
+A single cubic Bezier spline approximation must have the 4 control points:
+
+	(1, 0)
+	(1, h)
+	(cos(A) + h * sin(A), sin(A) - h * cos(A))
+	(cos(A), sin(A))
+
+Various approximations can be determined by selecting the value of
+h. A convenient value, (though not optimal in terms of error), is:
+
+	h = 4/3 * tan(A/4)
+
+From which we can determine the maximum error:
+
+	abs( max(e(t)) ) = 4/27 * (sin^6 (A/4)) / (cos^2 (A/4))
+	    t in [0,1]
+	




More information about the Commit mailing list