code: def remove_close(points, radius):
      
      from scipy.spatial import cKDTree as KDTree
  
      tree = KDTree(points)
      consumed = np.zeros(len(points), dtype=np.bool)
      unique = np.zeros(len(points), dtype=np.bool)
      for i in range(len(points)):
          if consumed[i]:
              continue
          neighbors = tree.query_ball_point(points[i], r=radius)
          consumed[neighbors] = True
          unique[i] = True
  
      return points[unique], unique
docs: Given an (n, m) set of points where n=(2|3) return a list of points
      where no point is closer than radius.
  
      Parameters
      ------------
      points : (n, dimension) float
        Points in space
      radius : float
        Minimum radius between result points
  
      Returns
      ------------
      culled : (m, dimension) float
        Points in space
      mask : (n,) bool
        Which points from the original set were returned