code: def np_get_occupied_idx(
      v,
      xmin=(0.0, 0.0, 0.0),
      xmax=(1.0, 1.0, 1.0),
      crop_size=0.125,
      ntarget=2048,
      overlap=True,
      normalize_crops=False,
      return_shape=False,
      return_crop_point_idxs=False,
  ):
      """Get crop indices for point clouds."""
      v = v.copy() - xmin
      xmin = np.array(xmin)
      xmax = np.array(xmax)
      r = (xmax - xmin) / crop_size
      r = np.ceil(r)
      rr = (
          r.astype(np.int32)
          if not overlap
          else (2 * r - 1).astype(np.int32)
      )
      # create index grid
      idx_grid = np.stack(
          np.meshgrid(
              np.arange(rr[0]),
              np.arange(rr[1]),
              np.arange(rr[2]),
              indexing="ij",
          ),
          axis=-1,
      )
      # [rr[0], rr[1], rr[2], 3]
  
      shift_idxs = np.stack(
          np.meshgrid(
              np.arange(int(overlap) + 1),
              np.arange(int(overlap) + 1),
              np.arange(int(overlap) + 1),
              indexing="ij",
          ),
          axis=-1,
      )
      shift_idxs = np.reshape(shift_idxs, [-1, 3])
      point_crops = []
      crop_indices = []
      crop_point_idxs = []
      for i in range(shift_idxs.shape[0]):
          sft = shift_idxs[i]
          skp = int(overlap) + 1
          idg = idx_grid[sft[0] :: skp, sft[1] :: skp, sft[2] :: skp]
          pc, ci, cpidx = np_shifted_crop(
              v, idg, sft, crop_size=crop_size, ntarget=ntarget
          )
          point_crops.append(pc)
          crop_indices.append(ci)
          crop_point_idxs += cpidx
      point_crops = np.concatenate(
          point_crops, axis=0
      )  # [ncrops, nsurface, 6]
      crop_indices = np.concatenate(crop_indices, axis=0)  # [ncrops, 3]
  
      if normalize_crops:
          # normalize each crop
          crop_corners = crop_indices * 0.5 * crop_size
          crop_centers = crop_corners + 0.5 * crop_size  # [ncrops, 3]
          crop_centers = crop_centers[
              :, np.newaxis, :
          ]  # [ncrops, 1, 3]
          point_crops[..., :3] = point_crops[..., :3] - crop_centers
          point_crops[..., :3] = point_crops[..., :3] / crop_size * 2
  
      outputs = [point_crops, crop_indices]
      if return_shape:
          outputs += [idx_grid.shape[:3]]
      if return_crop_point_idxs:
          outputs += [crop_point_idxs]
      return tuple(outputs)
  
file_path: graphics/tensorflow_graphics/projects/local_implicit_grid/core/point_utils.py
imports: import numpy
  from plyfile import PlyData
  from plyfile import PlyElement
label_desc: Use image node_id 6 for calling a global function with example usage: np_get_occupied_idx(v, xmin, xmax, crop_size, ntarget, overlap, normalize_crops, return_shape, return_crop_point_idxs) and returns: tuple