import javax.media.j3d.Shape3D;
import javax.vecmath.Point3d;
import com.sun.j3d.utils.geometry.*;

public class ContourTest{

//the result Shape3D from this method doesn't look correct
   public static Shape3D getTestShape(){
      Point3d[] coordinates = {
  //The outer contour:
  new Point3d(125.0,     929.9999999999999,     331.2499999999999 ),
  new Point3d(1875.0,  930.0,  1643.75),
  new Point3d(2000.0,  930.0,  1643.75),
  new Point3d(2000.0,  930.0,  2500.0),
  new Point3d(1875.0,  930.0,  2500.0 ),
  new Point3d(125.0,    930.0,  1187.5 ),

  //this time the senses of the polygons agree.
  //reversing won't fix

  //The hole:
  new Point3d(1865.0,  930.0,  1673.75),
  new Point3d(1970.0,  930.0,  1673.75),
  new Point3d(1970.0,  930.0000000000001,  2470.0),
  new Point3d(1885.0,  930.0000000000001,  2470.0),
  new Point3d(155.0,    930.0,  1172.5  ),
  new Point3d(155.0,    929.9999999999999,391.2499999999999)

                };

      int[] strips = {6,6};
      int[] contours = {2};

      GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
      gi.setCoordinates(coordinates);
      gi.setStripCounts(strips);
      gi.setContourCounts(contours);
      Triangulator tr = new Triangulator();
      tr.triangulate(gi);
      NormalGenerator ng = new NormalGenerator();
      ng.generateNormals(gi);
      return(new Shape3D(gi.getGeometryArray()));

   }
}
