func ExampleRemoveOverlaps() { v := []rect{ {-1, -2, 2, 2}, {-2, -2, 1, 2}, } vpsc.RemoveOverlaps(rects(v)) fmt.Printf("%v", v) // Output: [{0.001 -2 3.001 2} {-3.001 -2 -0.001 2}] }
func TestRemoveOverlaps(t *testing.T) { u, v := makeRects(100) vpsc.RemoveOverlaps(rects(v)) for i := range v { if d := dist(u[0], v[0]); d > 1e-6 { t.Log(i, d) t.Log(rects(u).Position(i)) t.Log(rects(v).Position(i)) } } }