comparison pkg/imports/sr.go @ 5429:02a5da2f03b4 marking-single-beam

Fixed clipping.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 11 Jul 2021 15:07:18 +0200
parents b8d5f1cd15fb
children aa199f280f64
comparison
equal deleted inserted replaced
5428:b8d5f1cd15fb 5429:02a5da2f03b4
642 feedback.Info("Building final mesh took %v.", time.Since(start)) 642 feedback.Info("Building final mesh took %v.", time.Since(start))
643 feedback.Info("Store mesh.") 643 feedback.Info("Store mesh.")
644 } else { 644 } else {
645 start = time.Now() 645 start = time.Now()
646 clippingPolygonBuffered.Indexify() 646 clippingPolygonBuffered.Indexify()
647 before := len(xyz)
647 xyz = xyz.Filter(func(v mesh.Vertex) bool { 648 xyz = xyz.Filter(func(v mesh.Vertex) bool {
648 return clippingPolygonBuffered.IntersectionBox2D(v.Box2D()) == 649 return clippingPolygonBuffered.IntersectionBox2D(v.Box2D()) !=
649 mesh.IntersectionOutSide 650 mesh.IntersectionOutSide
650 }) 651 })
651 feedback.Info("Clipping took %v.", time.Since(start)) 652 feedback.Info("Clipping took %v.", time.Since(start))
652 feedback.Info("Number of points to clip %d.", len(removed)) 653 feedback.Info("Number of points to clip %d.", before-len(xyz))
653 } 654 }
654 655
655 start = time.Now() 656 start = time.Now()
656 657
657 var ( 658 var (