code: public static float[] gridIdxToPoint(Grid grid, int idx) {
          int[] gridIdx = new int[3];
  
          int ydiv = grid.getDivision().getX();
          int zdiv = ydiv * grid.getDivision().getY();
  
          gridIdx[2] = idx / zdiv;
          idx -= gridIdx[2] * zdiv;
          gridIdx[1] = idx / ydiv;
          idx -= gridIdx[1] * ydiv;
          gridIdx[0] = idx;
  
          Vec3f size = grid.getSize();
          float[] point = {
                  gridIdx[0] * size.getX() + grid.getMin().getX(),
                  gridIdx[1] * size.getY() + grid.getMin().getY(),
                  gridIdx[2] * size.getZ() + grid.getMin().getZ()
          };
          return point;
      }
docs: Convert a grid index to a point.
  
  @param grid gird box definition
  @param idx  box id
  @return the min x/y/z for the given grid box (an array with size of 3)