if you store information about the edges at the connecting vertices,
ie you have a collection of edges which know about their 2 vertices and
a collection of vertices which know about the (possibly many) edges that
are connected to it
then you can do the following:
start with a random edge (first one makes it easier), ask it's first vertex
about another edge and iterate until you get an end (vertex of degree 1) then
go back to the edge you started with and do the same thing going the other way.
keep a flag on the edges which have been used and iterate over all edges.
(that why you probably want to start with the first so you can iterate until
the last one...)
this should work pretty well, that's what we use for edge/triangle strips.
thomas
On Fri, 25 Sep 1998 13:38:08, Karthik Balasubramaniam
>The output of my contouring routine is a series of line segments (3D)
>Now, how can I efficiently group them into polylines (since that allows
>for better display )? the final grouping itself need not be 'optimal'.
>An octree based approach...?
>I'd appreciate any suggestions/algorithms/code
>--
>Karthik Balasubramaniam