public List<Envelope> extrusion(final Envelope env){
  final List<Envelope> list=new ArrayList<>();
  final double x1=getMinX();
  final double x2=getMaxX();
  final double y1=getMinY();
  final double y2=getMaxY();
  final double xx1=env.getMinX();
  final double xx2=env.getMaxX();
  final double yy1=env.getMinY();
  final double yy2=env.getMaxY();
  if (x2 >= x1 && yy1 >= y1) {
    list.add(new Envelope(x1,x2,y1,yy1));
  }
  if (xx1 >= x1 && y2 >= yy1) {
    list.add(new Envelope(x1,xx1,yy1,y2));
  }
  if (x2 >= xx1 && y2 >= yy2) {
    list.add(new Envelope(xx1,x2,yy2,y2));
  }
  if (x2 >= xx2 && yy2 >= yy1) {
    list.add(new Envelope(xx2,x2,yy1,yy2));
  }
  return list;
}

public List < Envelope > extrusion ( final Envelope env ) { final List < Envelope > list = new ArrayList < > ( ) ; final double x1 = getMinX ( ) ; final double x2 = getMaxX ( ) ; final double y1 = getMinY ( ) ; final double y2 = getMaxY ( ) ; final double xx1 = env . getMinX ( ) ; final double xx2 = env . getMaxX ( ) ; final double yy1 = env . getMinY ( ) ; final double yy2 = env . getMaxY ( ) ; if ( x2 >= x1 && yy1 >= y1 ) { list . add ( new Envelope ( x1 , x2 , y1 , yy1 ) ) ; } if ( xx1 >= x1 && y2 >= yy1 ) { list . add ( new Envelope ( x1 , xx1 , yy1 , y2 ) ) ; } if ( x2 >= xx1 && y2 >= yy2 ) { list . add ( new Envelope ( xx1 , x2 , yy2 , y2 ) ) ; } if ( x2 >= xx2 && yy2 >= yy1 ) { list . add ( new Envelope ( xx2 , x2 , yy1 , yy2 ) ) ; } return list ; }
computes the list of envelopes ( from 2 to 4 , possibily 0 if env covers this ) resulting from the extrusion of env from this . only in 2d for the moment . does not return null envelopes .
