In some cases when i == len(SliceA) i get a slice out of bounds error.
//filterIntersection removes points from two slices that have common points.
func filterIntersection(sliceA, sliceB *[]ds.Coord) {
for i, a := range *sliceA {
for j, b := range *sliceB {
if a == b {
(*sliceA) = append((*sliceA)[:i], (*sliceA)[i+1:]...) <--- error here
(*sliceB) = append((*sliceB)[:j], (*sliceB)[j+1:]...)
}
}
}
}