public static Iterator createShape3D(Shape shape,double baselineHeight,Color color,boolean filled){
  int bufferSize=DEFAULT_NPOINTS_BUFFER_SIZE;
  double[] data=expandArrayD(bufferSize,null);
  int dataIndex=0;
  int refreshCounter=bufferSize;
  int[] stripCount=new int[1];
  stripCount[0]=0;
  PathIterator pi2=shape.getPathIterator(null);
  float flatness=.25f;
  FlatteningPathIterator pi=new FlatteningPathIterator(pi2,flatness);
  double[] coords=new double[6];
  double pntx=0;
  double pnty=0;
  double pntz=baselineHeight;
  HashSet set=new HashSet();
  Shape3D shape3D=null;
  Debug.message("3detail","OMGraphicUtil.createShape3D(): figuring out coordinates");
  while (!pi.isDone()) {
    int type=pi.currentSegment(coords);
switch (type) {
case PathIterator.SEG_MOVETO:
      if (dataIndex != 0) {
        shape3D=createShape3D(data,dataIndex,stripCount,color,filled);
        if (shape3D != null) {
          set.add(shape3D);
        }
        data=expandArrayD(bufferSize,null);
        dataIndex=0;
      }
case PathIterator.SEG_LINETO:
    pntx=coords[0];
  pnty=coords[1];
if (Debug.debugging("3detail")) {
  Debug.output("Shape coordinates: " + pntx + ", "+ pnty);
}
if (dataIndex >= data.length) {
data=expandArrayD(bufferSize,data);
refreshCounter=bufferSize;
}
data[dataIndex++]=pntx;
data[dataIndex++]=pntz;
data[dataIndex++]=pnty;
stripCount[0]++;
refreshCounter-=3;
break;
default :
Debug.message("3detail","Shape coordinates: " + coords[0] + ", "+ coords[1]+ " rounding out SEG_CLOSE");
}
pi.next();
}
if (dataIndex != 0) {
shape3D=createShape3D(data,dataIndex,stripCount,color,filled);
if (shape3D != null) {
set.add(shape3D);
}
}
return set.iterator();
}

public static Iterator createShape3D ( Shape shape , double baselineHeight , Color color , boolean filled ) { int bufferSize = DEFAULT_NPOINTS_BUFFER_SIZE ; double [ ] data = expandArrayD ( bufferSize , null ) ; int dataIndex = 0 ; int refreshCounter = bufferSize ; int [ ] stripCount = new int [ 1 ] ; stripCount [ 0 ] = 0 ; PathIterator pi2 = shape . getPathIterator ( null ) ; float flatness = .25f ; FlatteningPathIterator pi = new FlatteningPathIterator ( pi2 , flatness ) ; double [ ] coords = new double [ 6 ] ; double pntx = 0 ; double pnty = 0 ; double pntz = baselineHeight ; HashSet set = new HashSet ( ) ; Shape3D shape3D = null ; Debug . message ( "3detail" , "OMGraphicUtil.createShape3D(): figuring out coordinates" ) ; while ( ! pi . isDone ( ) ) { int type = pi . currentSegment ( coords ) ; switch ( type ) { case PathIterator . SEG_MOVETO : if ( dataIndex != 0 ) { shape3D = createShape3D ( data , dataIndex , stripCount , color , filled ) ; if ( shape3D != null ) { set . add ( shape3D ) ; } data = expandArrayD ( bufferSize , null ) ; dataIndex = 0 ; } case PathIterator . SEG_LINETO : pntx = coords [ 0 ] ; pnty = coords [ 1 ] ; if ( Debug . debugging ( "3detail" ) ) { Debug . output ( "Shape coordinates: " + pntx + ", " + pnty ) ; } if ( dataIndex >= data . length ) { data = expandArrayD ( bufferSize , data ) ; refreshCounter = bufferSize ; } data [ dataIndex ++ ] = pntx ; data [ dataIndex ++ ] = pntz ; data [ dataIndex ++ ] = pnty ; stripCount [ 0 ] ++ ; refreshCounter -= 3 ; break ; default : Debug . message ( "3detail" , "Shape coordinates: " + coords [ 0 ] + ", " + coords [ 1 ] + " rounding out SEG_CLOSE" ) ; } pi . next ( ) ; } if ( dataIndex != 0 ) { shape3D = createShape3D ( data , dataIndex , stripCount , color , filled ) ; if ( shape3D != null ) { set . add ( shape3D ) ; } } return set . iterator ( ) ; }
create an iterator containing a set of shape3d objects , created from a java . awt . shape .
