Mercurial > gemma
diff cmd/octree2contour/vertex.go @ 689:614135d69823 octree
octree: prepare storing the lines to file in contouring tool.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 20 Sep 2018 13:19:49 +0200 |
parents | be90ab542aa7 |
children | c0bba602b60e |
line wrap: on
line diff
--- a/cmd/octree2contour/vertex.go Thu Sep 20 11:32:03 2018 +0200 +++ b/cmd/octree2contour/vertex.go Thu Sep 20 13:19:49 2018 +0200 @@ -99,13 +99,15 @@ return 0 } -func (t *triangle) intersectH(h float64, points []vertex) []vertex { +func (t *triangle) intersectH(h float64) []vertex { sides := [3]int{ side(t[0].z, h), side(t[1].z, h), side(t[2].z, h), } + var points []vertex + for i := 0; i < 3; i++ { j := (i + 1) % 3 si := sides[i]