comparison cmd/octree2contour/main.go @ 681:a8d32a11b113 octree

octree: more consistent traversal order in contour tool.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 19 Sep 2018 18:39:03 +0200
parents c79c7be29a7a
children a2f107f1e4e7
comparison
equal deleted inserted replaced
680:c79c7be29a7a 681:a8d32a11b113
19 tree.horizontal(*step, func([]int32) { 19 tree.horizontal(*step, func([]int32) {
20 triangles++ 20 triangles++
21 }) 21 })
22 } else { 22 } else {
23 for h := tree.min.z; h <= tree.max.z; h += *step { 23 for h := tree.min.z; h <= tree.max.z; h += *step {
24 var level int
24 tree.horizontal(h, func([]int32) { 25 tree.horizontal(h, func([]int32) {
25 triangles++ 26 level++
26 }) 27 })
28 log.Printf("level %f: %d\n", h, level)
29 triangles += level
27 } 30 }
28 } 31 }
29 log.Printf("traversal took: %v\n", time.Since(start)) 32 log.Printf("traversal took: %v\n", time.Since(start))
30 log.Printf("num triangles: %d\n", triangles) 33 log.Printf("num triangles: %d\n", triangles)
31 } 34 }