code: public void diagonalAxisScanXZY(int dimK, int dimL, int dimM) {
          // x min ->x max;left upper corner z+y max->min//1
          //logger.debug("	diagonalAxisScanXZY");
          if (dimM < dimL) {
              dimL = dimM;
          }
          //int gridPoints = 0;//Debugging
          List<Point3d> line = new ArrayList<Point3d>();
          int pspEvent = 0;
          int m = 0;
          for (int j = dimM; j >= 1; j--) {// z
              line.clear();
              pspEvent = 0;
              for (int k = 0; k <= dimK; k++) {// min -> max; x
                  m = dimM;// m==y
                  line.clear();
                  pspEvent = 0;
                  for (int l = dimL; l >= 0; l--) {// z
                      //gridPoints++;
                      if (grid[k][m][l] < 0) {
                          if (pspEvent < 2) {
                              line.clear();
                              pspEvent = 1;
                          } else if (pspEvent == 2) {
                              firePSPEvent(line);
                              line.clear();
                              pspEvent = 1;
                          }
                      } else {
                          if (pspEvent == 1 | pspEvent == 2) {
                              line.add(new Point3d(k, m, l));
                              pspEvent = 2;
                          }
                      }
                      m--;
                  }// for l
              }
              dimL = j;
          }
          //logger.debug(" #gridPoints>" + gridPoints);
      }
docs: Method performs a scan; works only for cubic grids!
  
  @param dimK first dimension
  @param dimL second dimension
  @param dimM third dimension