code: @Pure
  	public static Point3d computeClosestPoint(
  			double minx, double miny, double minz,
  			double maxx, double maxy, double maxz,
  			double x, double y, double z) {
  		Point3d closest = new Point3d();
  		if (x < minx) {
  			closest.setX(minx);
  		}
  		else if (x > maxx) {
  			closest.setX(maxx);
  		}
  		else {
  			closest.setX(x);
  		}
  		if (y < miny) {
  			closest.setY(miny);
  		}
  		else if (y > maxy) {
  			closest.setY(maxy);
  		}
  		else {
  			closest.setY(y);
  		}
  		if (z < minz) {
  			closest.setZ(minz);
  		}
  		else if (z > maxz) {
  			closest.setZ(maxz);
  		}
  		else {
  			closest.setZ(z);
  		}
  		return closest;
  	}
docs: Replies the point on the shape that is closest to the given point.
  
  @param minx x coordinate of the lower point of the box.
  @param miny y coordinate of the lower point of the box.
  @param minz z coordinate of the lower point of the box.
  @param maxx x coordinate of the upper point of the box.
  @param maxy y coordinate of the upper point of the box.
  @param maxz z coordinate of the upper point of the box.
  @param x x coordinate of the point.
  @param y y coordinate of the point.
  @param z z coordinate of the point.
  @return the closest point on the shape; or the point itself
  if it is inside the shape.