[Commit] tess ChangeLog,1.23,1.24 bentley.5c,1.19,1.20

Carl Worth commit at keithp.com
Sat Jul 31 21:12:38 PDT 2004


Committed by: cworth

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

Modified Files:
	ChangeLog bentley.5c 
Log Message:

        * bentley.5c (bend_at_tolerance_squares): Add code to run through
        the edges within each tolerance square and insert the tolerance
        square centers into the edges. At this point, steps 1, 2, 3, and 5
        are basically implemented, and Hobby's little test case seems to
        pass. So all that's missing is an implementation of steps 4 and 6
        which involves accounting for tolerance squares passed into during
        swap events.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/tess/ChangeLog,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- ChangeLog	31 Jul 2004 22:01:49 -0000	1.23
+++ ChangeLog	1 Aug 2004 04:12:36 -0000	1.24
@@ -1,3 +1,13 @@
+2004-08-01  Carl Worth  <cworth at isi.edu>
+
+	* bentley.5c (bend_at_tolerance_squares): Add code to run through
+	the edges within each tolerance square and insert the tolerance
+	square centers into the edges. At this point, steps 1, 2, 3, and 5
+	are basically implemented, and Hobby's little test case seems to
+	pass. So all that's missing is an implementation of steps 4 and 6
+	which involves accounting for tolerance squares passed into during
+	swap events.
+
 2004-07-31  Carl Worth  <cworth at isi.edu>
 
 	* ALGORITHM: Add John Hooby's pseudo-code description of the

Index: bentley.5c
===================================================================
RCS file: /local/src/CVS/tess/bentley.5c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- bentley.5c	31 Jul 2004 22:01:49 -0000	1.19
+++ bentley.5c	1 Aug 2004 04:12:36 -0000	1.20
@@ -612,6 +612,7 @@
 Edge[*]
 bend_at_tolerance_squares (Event[*] events)
 {
+    Edge[...] result = {};
     int batch_y;
 
     /* XXX: We're currently using another skiplist for sweepline here,
@@ -624,6 +625,20 @@
 
     TSquareList tsquares;
 
+    void edge_insert_point (*Edge edge, Point point) {
+	/* Avoid emitting a degenerate edge if this edge has already
+	 * been used for a previous intersection at exactly the
+	 * same point. */
+	if (edge->middle == point)
+	    return;
+
+	result[dim(result)] = (Edge) {
+	    top = edge->middle,
+	    bottom = point
+	};
+	edge->middle = point;
+    }
+
     bool edge_greater (*Edge a, *Edge b) {
 
 	rational edge_x_for_y (*Edge e, int y) {
@@ -671,8 +686,6 @@
 	}
     }
 
-    Edge[...] result = {};
-
     if (dim(events) == 0)
 	return result;
 
@@ -720,6 +733,20 @@
 
 	merge_tsquares_with_sweep_line ();
 
+	for (TSquarePtr tp = Sortlist::first (tsquares);
+	     tp != TSquarePtr.nil;
+	     tp = Sortlist::next (tsquares, tp))
+	{
+	    *TSquare t = ElementTSquare (tp);
+	    for (EdgePtr e = t->left.next_edge;
+		 e != t->right.next_edge;
+		 e = Sortlist::next (sweep_line, e))
+	    {
+		edge_insert_point (ElementEdge (e),
+				   (Point) { x = t->x, y = batch_y});
+	    }
+	}
+
 	for (int i=batch_start; i < batch_stop; i++) {
 	    *Event event = &events[i];
 




More information about the Commit mailing list