Example #1
0
    void processModelVoxel(int x, int y, int z) {
      if (voxelChecker != null) {
        if (!voxelChecker.canProcess(x, y, z)) {
          return;
        }
      }
      int nlength = neighbors.length;
      int index = 0;
      while (index < nlength) {
        int ix = neighbors[index++];
        int iy = neighbors[index++];
        int iz = neighbors[index++];
        int xx = x + ix;
        int yy = y + iy;
        int zz = z + iz;
        if (xx >= 0 && xx < nx && yy >= 0 && yy < ny && zz >= 0 && zz < nz) {

          if (grid.getState(xx, yy, zz) == OUTSIDE) {
            // we have outside neighbor, set mask to
            surfaceMask.set(x, y, z, 1);
            return;
          }
        }
      }
    }
Example #2
0
 void processModelVoxel(int x, int y, int z) {
   if (voxelChecker != null) {
     if (!voxelChecker.canProcess(x, y, z)) {
       return;
     }
   }
   for (int iy = -ballSize; iy <= ballSize; iy++) {
     for (int ix = -ballSize; ix <= ballSize; ix++) {
       for (int iz = -ballSize; iz <= ballSize; iz++) {
         int r2 = (ix * ix + iy * iy + iz * iz);
         if (r2 <= ballSize2) {
           // printf("%d \n", r2, );
           if (grid.getState(x + ix, y + iy, z + iz) == OUTSIDE) {
             //
             surfaceMask.set(x, y, z, 1);
             return;
           }
         }
       }
     }
   }
 }