diff pkg/octree/vertex.go @ 2512:2768f74d54ab octree-diff

Added an STRTree for the triangulation. Should be better suited for filtering out the clipped triangles.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 05 Mar 2019 13:05:50 +0100
parents a727e0426240
children 45d51a49f191
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Mon Mar 04 18:16:13 2019 +0100
+++ b/pkg/octree/vertex.go	Tue Mar 05 13:05:50 2019 +0100
@@ -723,6 +723,15 @@
 	return a.Y2
 }
 
+func (a Box2D) Union(b Box2D) Box2D {
+	return Box2D{
+		X1: math.Min(a.X1, b.X1),
+		Y1: math.Min(a.Y1, b.Y1),
+		X2: math.Max(a.X2, b.X2),
+		Y2: math.Max(a.Y2, b.Y2),
+	}
+}
+
 // NewPlane2D creates a new Plane2D from two given points.
 func NewPlane2D(x1, y1, x2, y2 float64) Plane2D {
 	b := x2 - x1