diff pkg/octree/vertex.go @ 4726:c91e759007da stack-polygons

Started with stacking shells and holes of generated polygons correctly.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 17 Oct 2019 18:33:46 +0200
parents 23236657b032
children a2f16bbcc846
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Thu Oct 17 16:36:58 2019 +0200
+++ b/pkg/octree/vertex.go	Thu Oct 17 18:33:46 2019 +0200
@@ -108,6 +108,11 @@
 	}
 }
 
+func (a Box2D) Inside(b Box2D) bool {
+	return a.X1 >= b.X1 && a.X2 <= b.X2 &&
+		a.Y1 >= b.Y1 && a.Y2 <= b.Y2
+}
+
 func (p Plane3D) Z(x, y float64) float64 {
 	// p.A*x + p.B*y + p.C*z + p.D = 0
 	return -(p.A*x + p.B*y + p.D) / p.C