[Commit] tess ChangeLog,1.6,1.7 bentley.5c,1.7,1.8
Carl Worth
commit at keithp.com
Wed Jul 7 12:34:44 PDT 2004
Committed by: cworth
Update of /local/src/CVS/tess
In directory home.keithp.com:/tmp/cvs-serv3342
Modified Files:
ChangeLog bentley.5c
Log Message:
* bentley.5c (bentley_ottman): Fix insert_event_if to use
intersect_segments rather than a custom, (and inadequate in the
case of horizontal lines) check for containment of the
intersection within the segments. Add note on future slope
comparison optimization.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/tess/ChangeLog,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ChangeLog 7 Jul 2004 19:26:59 -0000 1.6
+++ ChangeLog 7 Jul 2004 19:34:41 -0000 1.7
@@ -1,5 +1,13 @@
2004-07-07 Carl Worth <cworth at isi.edu>
+ * bentley.5c (bentley_ottman): Fix insert_event_if to use
+ intersect_segments rather than a custom, (and inadequate in the
+ case of horizontal lines) check for containment of the
+ intersection within the segments. Add note on future slope
+ comparison optimization.
+
+2004-07-07 Carl Worth <cworth at isi.edu>
+
* bentley.5c (bentley_ottman): Cosmetic changes: Rename
insert_event_if_intersect to
insert_event_if_intersect_below_current_y and use more descriptive
Index: bentley.5c
===================================================================
RCS file: /local/src/CVS/tess/bentley.5c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- bentley.5c 7 Jul 2004 19:26:59 -0000 1.7
+++ bentley.5c 7 Jul 2004 19:34:41 -0000 1.8
@@ -364,17 +364,29 @@
if (left == Sortlist::List.nil || right == Sortlist::List.nil)
return;
+/* XXX: Hobby suggests an initial slope comparison before the
+ * intersection test, which is faster for the common case. But I don't
+ * see an easy way to make this work with horizontal
+ * edges. Fortunately, we plan to get rid of those.
+ *
+ * When this test is enabled, we can drop the comparison between
+ * intersection.c and current_y below.
+ */
+/*
+ if (slope_greater (*left.elt, *right.elt))
+ return;
+*/
+
RationalPoint intersection;
try {
- intersection = intersect_lines (*left.elt, *right.elt);
+ intersection = intersect_segments (*left.elt, *right.elt);
} catch parallel () {
return;
+ } catch no_intersection () {
+ return;
}
- if (intersection.y > current_y
- && intersection.y < left.elt->bottom.y
- && intersection.y < right.elt->bottom.y
- )
+ if (intersection.y > current_y)
{
Sortlist::insert (&event_queue,
(EventPtr.elt) &(Event) {
More information about the Commit
mailing list