comparison cmd/octreediff/main.go @ 2575:59e7a011d347

Morphological differences: Moved TIN clipping to octree package and hide the technical details there.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 11 Mar 2019 14:50:04 +0100
parents 2833ff156cb2
children 647a58ee9ae9
comparison
equal deleted inserted replaced
2574:2833ff156cb2 2575:59e7a011d347
232 232
233 now = time.Now() 233 now = time.Now()
234 log.Printf("triangulation took %v\n", now.Sub(last)) 234 log.Printf("triangulation took %v\n", now.Sub(last))
235 last = now 235 last = now
236 236
237 var str octree.STRTree
238
239 tin := tri.Tin() 237 tin := tri.Tin()
240 238
241 str.Build(tin) 239 removed := tin.Clip(clippingPolygon)
242 240 now = time.Now()
243 now = time.Now() 241 log.Printf("clipping tin took %v\n", now.Sub(last))
244 log.Printf("building STR tree took %v\n", now.Sub(last))
245 last = now
246
247 removed := str.Clip(clippingPolygon)
248 now = time.Now()
249 log.Printf("clipping STR tree took %v\n", now.Sub(last))
250 last = now 242 last = now
251 243
252 log.Printf("Number of triangles to clip: %d\n", len(removed)) 244 log.Printf("Number of triangles to clip: %d\n", len(removed))
253 245
254 builder := octree.NewBuilder(tin) 246 builder := octree.NewBuilder(tin)