[Commit] tess ChangeLog,1.18,1.19 kbentley.5c,1.4,1.5
Carl Worth
commit at keithp.com
Wed Jul 28 20:20:32 PDT 2004
Committed by: cworth
Update of /local/src/CVS/tess
In directory home.keithp.com:/tmp/cvs-serv8570
Modified Files:
ChangeLog kbentley.5c
Log Message:
* kbentley.5c: Minor changes to re-synch bentley.5c and
kbentley.5c.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/tess/ChangeLog,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ChangeLog 24 Jul 2004 07:33:13 -0000 1.18
+++ ChangeLog 29 Jul 2004 03:20:30 -0000 1.19
@@ -1,3 +1,8 @@
+2004-07-28 Carl Worth <cworth at isi.edu>
+
+ * kbentley.5c: Minor changes to re-synch bentley.5c and
+ kbentley.5c.
+
2004-07-24 Carl Worth <cworth at isi.edu>
* kbentley.5c: Fix a couple things that I didn't mean to commit.
Index: kbentley.5c
===================================================================
RCS file: /local/src/CVS/tess/kbentley.5c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kbentley.5c 24 Jul 2004 07:33:13 -0000 1.4
+++ kbentley.5c 29 Jul 2004 03:20:30 -0000 1.5
@@ -152,7 +152,7 @@
/* At this stage we are looking at two events of the same type at
* the same point. The final sort key is a slope comparison. We
- * need a difference sens for start and stop events based on the
+ * need a difference sense for start and stop events based on the
* shortening rule.
*
* NOTE: Fortunately, we get to ignore errors in the relative
@@ -190,27 +190,34 @@
return a * d - b * c;
}
- int dx1 = a.top.x - a.bottom.x;
- int dy1 = a.top.y - a.bottom.y;
+ int dx1 = a.top.x - a.bottom.x; /* 32 */
+ int dy1 = a.top.y - a.bottom.y; /* 32 */
- int dx2 = b.top.x - b.bottom.x;
- int dy2 = b.top.y - b.bottom.y;
+ int dx2 = b.top.x - b.bottom.x; /* 32 */
+ int dy2 = b.top.y - b.bottom.y; /* 32 */
- int den_det = det (dx1, dy1, dx2, dy2);
+ int den_det = det (dx1, dy1, dx2, dy2); /* 64 */
if (den_det == 0)
raise parallel ();
int a_det = det (a.top.x, a.top.y,
- a.bottom.x, a.bottom.y);
+ a.bottom.x, a.bottom.y); /* 64 */
int b_det = det (b.top.x, b.top.y,
- b.bottom.x, b.bottom.y);
-
+ b.bottom.x, b.bottom.y); /* 64 */
+
+ /* We could get a result here with up to 96 bits, but anything
+ * outside the range of 32 bits is infinity so we can throw it
+ * away. So we have a 32-bit result. But then, we also need 2 more
+ * bits of precision so that we can compare correctly with
+ * tolerance square edges lying half-way between grid
+ * positions. This involves being careful with the remainder from
+ * the division. Keith will help me get that part right. */
return (RationalPoint) {
x = det (a_det, dx1,
- b_det, dx2) / den_det,
+ b_det, dx2) / den_det, /* 96 / 64 => 96 */
y = det (a_det, dy1,
- b_det, dy2) / den_det
+ b_det, dy2) / den_det /* 96 / 64 => 96 */
};
}
@@ -494,6 +501,15 @@
int ady = a->bottom.y - a->top.y;
int bdy = b->bottom.y - b->top.y;
+ if (ady == 0)
+ ax = a.elt->top.x;
+ else
+ ax = a.elt->top.x + (current_y - a.elt->top.y) * adx / ady;
+ if (bdy == 0)
+ bx = b.elt->top.x;
+ else
+ bx = b.elt->top.x + (current_y - b.elt->top.y) * bdx / bdy;
+
int ax = bdy*(adx*(current_y - a->top.y) + a->top.x * ady);
int bx = ady*(bdx*(current_y - b->top.y) + b->top.x * bdy);
@@ -659,7 +675,7 @@
int intersections;
do {
- iterations++;
+ printf ("%d ", iterations++);
old_edges = edges;
edges = bentley_ottman(old_edges, &intersections);
} while (intersections > 0);
More information about the Commit
mailing list