Mercurial > gemma
comparison pkg/octree/strtree.go @ 4642:b5d9647c5bc1 stree-experiment
Fixed construction of clipped STRTree.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 11 Oct 2019 23:36:28 +0200 |
parents | 5ef04ae34872 |
children | a1a9b1eab57c |
comparison
equal
deleted
inserted
replaced
4641:5ef04ae34872 | 4642:b5d9647c5bc1 |
---|---|
90 | 90 |
91 s.tin = t | 91 s.tin = t |
92 | 92 |
93 all := make([]int32, 0, len(t.Triangles)-len(remove)) | 93 all := make([]int32, 0, len(t.Triangles)-len(remove)) |
94 | 94 |
95 for i := range all { | 95 for i := 0; i < len(t.Triangles); i++ { |
96 idx := int32(i) | 96 idx := int32(i) |
97 if _, found := remove[idx]; !found { | 97 if _, found := remove[idx]; !found { |
98 all = append(all, idx) | 98 all = append(all, idx) |
99 } | 99 } |
100 all[i] = int32(i) | |
101 } | 100 } |
102 | 101 |
103 s.index = append(s.index, 0) | 102 s.index = append(s.index, 0) |
104 | 103 |
105 root := s.build(all) | 104 root := s.build(all) |