Mercurial > gemma
diff pkg/mesh/vertex.go @ 5418:e89ff1894bb4 marking-single-beam
Don't clip the points against the border polygon. The implemented way was wrong.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 07 Jul 2021 18:27:40 +0200 |
parents | 31b0e865e7a0 |
children | 202715173935 |
line wrap: on
line diff
--- a/pkg/mesh/vertex.go Wed Jul 07 18:14:04 2021 +0200 +++ b/pkg/mesh/vertex.go Wed Jul 07 18:27:40 2021 +0200 @@ -1134,6 +1134,20 @@ return out } +// All returns all points as an iterator. +func (mpz MultiPointZ) All() func() (Vertex, bool) { + var idx int + return func() (v Vertex, ok bool) { + if idx >= len(mpz) { + ok = false + return + } + v, ok = mpz[idx], true + idx++ + return + } +} + // FilterRemoved returns an iterator that only delivers the vertices // which indices are not marked as removed. func (mpz MultiPointZ) FilterRemoved(removed map[int32]struct{}) func() (Vertex, bool) {