diff pkg/octree/vertex.go @ 813:1a808929c2c5

Cross sections: Fixed problem that certain inputs don't deliver data.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 27 Sep 2018 17:32:25 +0200
parents 0cc97135717c
children 01019d4c8359
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Thu Sep 27 17:25:03 2018 +0200
+++ b/pkg/octree/vertex.go	Thu Sep 27 17:32:25 2018 +0200
@@ -567,15 +567,15 @@
 					}
 					l := (k + 1) % 3
 					other := NewPlane2D(t[k].X, t[k].Y, t[l].X, t[l].Y)
-					xo, yo, intersects := vl.line.Intersection(edge)
+					xo, yo, intersects := vl.line.Intersection(other)
 					if !intersects {
 						continue
 					}
-					t2 := relative(t[k], t[j])(xo, yo)
+					t2 := relative(t[k], t[l])(xo, yo)
 					if !inRange(t2) {
 						continue
 					}
-					zo := interpolate(t[k].Z, t[j].Z)(t2)
+					zo := interpolate(t[k].Z, t[l].Z)(t2)
 
 					m := Vertex{xo, yo, zo}