From: Tom Browder <tom2@fw...>  20001107 13:50:42

Stephane, thanks for the speedy replyI found your previous answer to my query from before, so I apologize for asking twice. On a project I am working on using gts, I define edge sets the following way based on the indices of the end points: an edge bounded by points 4 and 3: "3_4" an edge bounded by points 3 and 4: "3_4" Note that an edge is defined by putting its lower point index first, followed by the underscore, followed by the higher point index. Then a face (polygon) becomes "left" or "right" at an edge depending on the numerical order of the point indices when tracing the face point indices counterclockwise on the outward side: if the order is low to high, then the face is a "left" one if the order is high to low, then the face is a "right" one Defining the edges the way I have enables use of C++'s STL map containers to manage a set of unique edges. I look forward to continued use of gts. Thanks for you efforts. Tom Browder Original Message From: Stephane Popinet <popinet@...> To: gtsgeneral@... <gtsgeneral@...> Date: Tuesday, November 07, 2000 6:52 AM Subject: Re: [gtsgeneral] Vertices, Edges, and Faces >Tom Browder wrote: >> >> Could someone please explain to me (againI'm simpleminded) how to define a >> simple surface and get the gts file right? I'm having >> trouble figuring out how the edges define the face. Specifically, how do I get >> from a face to the proper vertex index ordering for >> a counterclockwiseoutward normal? >> >> Thanks. >> >> Tom Browder >> >> P.S. A simple surface consisting of four vertices and two adjacent triangles would > do it. > >Hi Tom, > >The only thing to understand really is that edges are not oriented >(otherwise they couldn't be shared between two triangles). What defines >the orientation of a triangle is the order of its three edges (t>e1, >t>e2, t>e3). Knowing that each edge shares a common endpoint with the >others, you can then go back to the vertex ordering you need. That's a >little tedious to do obviously and the macro gts_triangle_points (t, v1, >v2, v3) will do that for you: return in v1, v2 and v3 the vertices of t >appearing in counterclockwise order (sorry it's not in the doc yet). If >you are only interested in the normal vector, you can use >gts_triangle_normal (). > >Hope it helps, > >Stephane >_______________________________________________ >Gtsgeneral mailing list >Gtsgeneral@... >http://lists.sourceforge.net/mailman/listinfo/gtsgeneral > 