Mercurial > gemma
diff pkg/octree/vertex.go @ 4550:aa2d0006e742 iso-areas
Write iso lines between classes to SVG for debugging.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 30 Sep 2019 16:34:55 +0200 |
parents | 56f4e8cbfab7 |
children | 23236657b032 |
line wrap: on
line diff
--- a/pkg/octree/vertex.go Mon Sep 30 14:59:20 2019 +0200 +++ b/pkg/octree/vertex.go Mon Sep 30 16:34:55 2019 +0200 @@ -483,6 +483,14 @@ math.Abs(v.Y-w.Y) < eps && math.Abs(v.Z-w.Z) < eps } +// EpsEquals returns true if v and w are equal component-wise +// in the X/Y plane with the values within a epsilon range. +func (v Vertex) EpsEquals2D(w Vertex) bool { + const eps = 1e-5 + return math.Abs(v.X-w.X) < eps && + math.Abs(v.Y-w.Y) < eps +} + // JoinOnLine joins the the elements of a given multi line string // under the assumption that the segments are all on the line segment // from (x1, y1) to (x2, y2).