diff pkg/octree/tree.go @ 778:9be20bd0f131

Fixed a bug with 2d planes (lines) found while working on line intersections. Added unit test.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 26 Sep 2018 13:17:32 +0200
parents c55771b7c502
children 3d927e06b92c
line wrap: on
line diff
--- a/pkg/octree/tree.go	Wed Sep 26 12:44:22 2018 +0200
+++ b/pkg/octree/tree.go	Wed Sep 26 13:17:32 2018 +0200
@@ -100,8 +100,9 @@
 				v1 := line.Eval(t[1].X, t[1].Y)
 				v2 := line.Eval(t[2].X, t[2].Y)
 
-				if math.Abs(v0) < eps || math.Abs(v1) < eps ||
-					math.Abs(v2) < eps ||
+				if math.Abs(v0) < epsPlane ||
+					math.Abs(v1) < epsPlane ||
+					math.Abs(v2) < epsPlane ||
 					sides(sides(sides(0, v0), v1), v2) == 3 {
 					fn(&t)
 				}