Hi,

   This may related to

   bug 4391167 - Triangulator unable to handle some polygons with holes.

- Kelvin
------------
Java 3D Team
Sun Microsystems Inc.

>X-Lotus-FromDomain: RES
>Mime-Version: 1.0
>Content-Disposition: inline
>Date: Fri, 12 Jan 2001 14:32:34 -0500
>From: Jean-Marie Dautelle <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] GeometryInfo Bug?
>Comments: To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>
>Hi,
>Sorry Daniel. But it doesn't work!
>Here is the wireframe obtained: (See attached file: shape1.JPG)
>For the solid version nothing appears!
>Regards.
>Jean-Marie.
>
>Note: Here is the complete code: (See attached file: HoleTest.java)
>
>
>
>
>
>Daniel Selman <[EMAIL PROTECTED]> on 01/12/2001 10:16:55 AM
>
>Please respond to [EMAIL PROTECTED]
>
>To:   [EMAIL PROTECTED]
>cc:    (bcc: Jean-Marie R Dautelle/RES/Raytheon/US)
>Subject:  Re: [JAVA3D] GeometryInfo Bug?
>
>
>
>Jean-Marie,
>
>Here is a short example. As you discovered the documentation for this
>feature is not very useful...!
>
>Sincerely,
>
>Daniel Selman
>
>[EMAIL PROTECTED]
>
>Tornado Labs Ltd.
>http://www.tornadolabs.com
>
>generate a surface from 10 vertices and create a hole in the surface by
>removing
>a hole defined using 5 vertices. Note that the hole must be entirely within
>the
>outer polygon.
>
>private double[]        m_VertexArray = {1,1,0, //0
>                                                                0,3,0, //1
>                                                                1,5,0, //2
>                                                                2,4,0, //3
>                                                                4,5,0, //4
>                                                                3,3,0, //5
>                                                                4,2,0, //6
>                                                                4,0,0, //7
>                                                                3,0,0, //8
>                                                                2,1,0, //9
>these are vertices for the hole
>                                                                1,3,0, //10
>                                                                2,3,0, //11
>                                                                3,2,0, //12
>                                                                3,1,0, //13
>                                                                2,2,0};//14
>triangulate the polygon
>GeometryInfo gi = new GeometryInfo( GeometryInfo.POLYGON_ARRAY );
>
>gi.setCoordinates( m_VertexArray );
>
>the first 10 points make up the outer edge of the polygon, the next five
>make up the hole
>int[] stripCountArray = {10,5};
>int[] countourCountArray = {stripCountArray.length};
>
>gi.setContourCounts( countourCountArray );
>gi.setStripCounts( stripCountArray );
>
>Triangulator triangulator = new Triangulator();
>triangulator.triangulate( gi );
>
>also generate normal vectors so that the surface can be light
>NormalGenerator normalGenerator = new NormalGenerator();
>normalGenerator.generateNormals( gi );
>
>create an appearance
>Appearance ap = new Appearance();
>
>render as a wireframe
>PolygonAttributes polyAttrbutes = new PolygonAttributes();
>polyAttrbutes.setPolygonMode( PolygonAttributes.POLYGON_LINE );
>polyAttrbutes.setCullFace( PolygonAttributes.CULL_NONE ) ;
>ap.setPolygonAttributes( polyAttrbutes );
>
>add both a wireframe and a solid version of the triangulated surface
>Shape3D shape1 = new Shape3D( gi.getGeometryArray(), ap );
>Shape3D shape2 = new Shape3D( gi.getGeometryArray() );
>
>-----Original Message-----
>From: Discussion list for Java 3D API
>[mailto:[EMAIL PROTECTED]]On Behalf Of Jean-Marie Dautelle
>Sent: Thursday, January 11, 2001 3:44 PM
>To: [EMAIL PROTECTED]
>Subject: GeometryInfo Bug?
>
>
>Could someone give me an example of code to create a polygon with an hole in
>it
>using com.sun.j3d.utils.geometry.GeometryInfo.setContourCounts(int[]).
>I tried everything and it doesn't seem to work!?? (I suspect a bug...).
>Thanks.
>
>===========================================================================
>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".
>
>===========================================================================
>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".
>
>
>
>

===========================================================================
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