/** * An empty Region with size (0,0,0). * @return An empty Region3i */ public static Region3i empty() { return new Region3i(); }
/** * @param min the min point of the region * @param size the size of the region * @return a new region base on the min point and region size, empty if the size is negative */ public static Region3i createFromMinAndSize(BaseVector3i min, BaseVector3i size) { if (size.x() <= 0 || size.y() <= 0 || size.z() <= 0) { return empty(); } return new Region3i(min, size); }
/** * Create a region by two point * @param min the min point of the region * @param max the max point of the region * @return a new region base on min and max point */ public static Region3i createFromMinMax(BaseVector3i min, BaseVector3i max) { Vector3i size = new Vector3i(max.x() - min.x() + 1, max.y() - min.y() + 1, max.z() - min.z() + 1); if (size.x <= 0 || size.y <= 0 || size.z <= 0) { return empty(); } return new Region3i(min, size); }