Mercurial > gemma
comparison pkg/octree/strtree.go @ 4704:9eb708176b43
STRTree: more efficent usage of slicing in collecting triangles during clipping.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 16 Oct 2019 18:22:33 +0200 |
parents | 6e179b338f1a |
children | a2f16bbcc846 |
comparison
equal
deleted
inserted
replaced
4703:6e179b338f1a | 4704:9eb708176b43 |
---|---|
329 if top > 0 { // node | 329 if top > 0 { // node |
330 n := s.index[top+1] | 330 n := s.index[top+1] |
331 stack = append(stack, s.index[top+2:top+2+n]...) | 331 stack = append(stack, s.index[top+2:top+2+n]...) |
332 } else { // leaf | 332 } else { // leaf |
333 top = -top - 1 | 333 top = -top - 1 |
334 for i, n := int32(0), s.index[top+1]; i < n; i++ { | 334 n := s.index[top+1] |
335 tris[s.index[top+2+i]] = struct{}{} | 335 for _, idx := range s.index[top+2 : top+2+n] { |
336 tris[idx] = struct{}{} | |
336 } | 337 } |
337 } | 338 } |
338 } | 339 } |
339 } | 340 } |
340 | 341 |