code: public void setDimension(double[] minMax, boolean cubicGridFlag) {
          if (cubicGridFlag) {
              double min = minMax[0];
              double max = minMax[0];
              for (int i = 0; i < minMax.length; i++) {
                  if (minMax[i] < min) {
                      min = minMax[i];
                  } else if (minMax[i] > max) {
                      max = minMax[i];
                  }
              }
              setDimension(min, max);
          } else {
              this.minx = minMax[0];
              this.maxx = minMax[1];
              this.miny = minMax[2];
              this.maxy = minMax[3];
              this.minz = minMax[4];
              this.maxz = minMax[5];
          }
      }
docs: Method sets the maximal 3d dimensions to given min and max values.