changeset 718:c0bba602b60e octree

octree: define a type for LineStringZ.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 21 Sep 2018 14:47:44 +0200
parents fdd88e95bae7
children d1b60ad2f50d
files cmd/octree2contour/store.go cmd/octree2contour/vertex.go
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/cmd/octree2contour/store.go	Fri Sep 21 11:03:20 2018 +0200
+++ b/cmd/octree2contour/store.go	Fri Sep 21 14:47:44 2018 +0200
@@ -7,7 +7,10 @@
 	"math"
 )
 
-type multiLineStringZ [][]vertex
+type (
+	lineStringZ      []vertex
+	multiLineStringZ []lineStringZ
+)
 
 const (
 	wkbNDR              byte   = 1
--- a/cmd/octree2contour/vertex.go	Fri Sep 21 11:03:20 2018 +0200
+++ b/cmd/octree2contour/vertex.go	Fri Sep 21 14:47:44 2018 +0200
@@ -99,14 +99,14 @@
 	return 0
 }
 
-func (t *triangle) intersectH(h float64) []vertex {
+func (t *triangle) intersectH(h float64) lineStringZ {
 	sides := [3]int{
 		side(t[0].z, h),
 		side(t[1].z, h),
 		side(t[2].z, h),
 	}
 
-	var points []vertex
+	var points lineStringZ
 
 	for i := 0; i < 3; i++ {
 		j := (i + 1) % 3