code: def resample_path(points,
                    count=None,
                    step=None,
                    step_round=True):
      
  
      points = np.array(points, dtype=np.float)
      # generate samples along the perimeter from kwarg count or step
      if (count is not None) and (step is not None):
          raise ValueError('Only step OR count can be specified')
      if (count is None) and (step is None):
          raise ValueError('Either step or count must be specified')
  
      sampler = PathSample(points)
      if step is not None and step_round:
          if step >= sampler.length:
              return points[[0, -1]]
  
          count = int(np.ceil(sampler.length / step))
  
      if count is not None:
          samples = np.linspace(0, sampler.length, count)
      elif step is not None:
          samples = np.arange(0, sampler.length, step)
  
      resampled = sampler.sample(samples)
  
      check = np.linalg.norm(points[[0, -1]] - resampled[[0, -1]], axis=1)
      assert check[0] < constants.tol_path.merge
      if count is not None:
          assert check[1] < constants.tol_path.merge
  
      return resampled
docs: Given a path along (n,d) points, resample them such that the
      distance traversed along the path is constant in between each
      of the resampled points. Note that this can produce clipping at
      corners, as the original vertices are NOT guaranteed to be in the
      new, resampled path.
  
      ONLY ONE of count or step can be specified
      Result can be uniformly distributed (np.linspace) by specifying count
      Result can have a specific distance (np.arange) by specifying step
  
  
      Parameters
      ----------
      points:   (n, d) float
          Points in space
      count : int,
          Number of points to sample evenly (aka np.linspace)
      step : float
          Distance each step should take along the path (aka np.arange)
  
      Returns
      ----------
      resampled : (j,d) float
          Points on the path