Hello,

I have a problem using GeometryInfo.

I use GeometryInfo to cut a hole in a polygon. With the following data I get the error message “java.lang.IllegalArgumentException: Sum of contourCounts must equal length of stripCounts array”

But the sum of the contourcounts equals 8 (=4+4) what is exactly the number of the coords. (the first 4 coords are the polygon and the last 4 coords are from the hole inside). Who can tell me what im doing wrong.

 

With regards Aant van der Zee

 

 

coord: (-3.924, 2.7, -15.614)

coord: (-3.924, 2.7, -4.064)

coord: (-3.924, 0.0, -4.064)

coord: (-3.924, 0.0, -15.614)

coord: (-3.924, 0.6, -15.314)

coord: (-3.924, 2.4, -15.314)

coord: (-3.924, 2.4, -4.9640007)

coord: (-3.924, 0.6, -4.9640007)

 

countorcounts[0] = 4

countorcounts[0] = 4

 

 

private GeometryArray createGeometryArray(Point3f[] coords,

                                            int[] contourCounts,

                                            Color3f[] colors) {

 

    GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);

 

    gi.setCoordinates(coords);

    if ( colors != null )

      gi.setColors(colors);

 

    int[] ii = {

        coords.length};

    gi.setStripCounts(ii);

 

    if ( contourCounts != null) {

      gi.setContourCounts(contourCounts);

    }

 

    NormalGenerator ngi = new NormalGenerator();

    ngi.generateNormals(gi);

 

    Stripifier sti = new Stripifier();

    sti.stripify(gi);

 

    return gi.getGeometryArray();

  }

 

=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to