[GRASS-SVN] r72352 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 11 14:57:29 PDT 2018


Author: mmetz
Date: 2018-03-11 14:57:29 -0700 (Sun, 11 Mar 2018)
New Revision: 72352

Modified:
   grass/trunk/lib/vector/Vlib/intersect2.c
Log:
Vlib: fix self-intersections in Vect_line_intersection2()

Modified: grass/trunk/lib/vector/Vlib/intersect2.c
===================================================================
--- grass/trunk/lib/vector/Vlib/intersect2.c	2018-03-11 19:39:39 UTC (rev 72351)
+++ grass/trunk/lib/vector/Vlib/intersect2.c	2018-03-11 21:57:29 UTC (rev 72352)
@@ -252,6 +252,8 @@
 	if (ret == 1) {		/* one intersection on segment A */
 	    G_debug(3, "    in %f, %f ", x1, y1);
 	    add_cross(i, 0.0, j, 0.0, x1, y1);
+	    if (APnts == BPnts)
+		add_cross(j, 0.0, i, 0.0, x1, y1);
 	}
 	else if (ret == 2 || ret == 3 || ret == 4 || ret == 5) {
 	    /*  partial overlap; a broken in one, b broken in one
@@ -261,6 +263,10 @@
 	    G_debug(3, "    in %f, %f; %f, %f", x1, y1, x2, y2);
 	    add_cross(i, 0.0, j, 0.0, x1, y1);
 	    add_cross(i, 0.0, j, 0.0, x2, y2);
+	    if (APnts == BPnts) {
+		add_cross(j, 0.0, i, 0.0, x1, y1);
+		add_cross(j, 0.0, i, 0.0, x2, y2);
+	    }
 	}
     }
     return 1;			/* keep going */



More information about the grass-commit mailing list