Re: half edge data structure
- From: Ernie Wright <erniew@xxxxxxxxxxx>
- Date: Mon, 24 Mar 2008 12:07:25 -0400
broli wrote:
On Mar 24, 7:29 pm, Morris Dovey <mrdo...@xxxxxxxx> wrote:
It appears to me that it should be sufficient to work your way
through the triangles and use the vertex indices to get at the
vertex coordinates.
Yes, but wouldn't it be very inefficient to traverse through say 1200
triangles and then for each triangle prepare list of edges, then
prepare common vertex list, common edge list etc ?
How else can it be done?
I've done this for *much* larger models. It doesn't take long at all.
Sort the edge list by lower-numbered vertex. Duplicate edge records
will be adjacent to each other in the sorted list. Consolidate those to
create a list of unique edges.
With appropriate choices of data structure, each edge record can contain
references to all of the triangles that share it, and each triangle can
contain references to its three edges in the edge list. You can then
find, given a triangle, all the triangles that share any of its three
edges, or given an edge, all the triangles that share that edge. (Note
that if the meshes aren't restricted to two-manifolds, there may be more
than two triangles sharing an edge.)
- Ernie http://home.comcast.net/~erniew
.
- Follow-Ups:
- Re: half edge data structure
- From: Morris Dovey
- Re: half edge data structure
- References:
- half edge data structure
- From: broli
- Re: half edge data structure
- From: Morris Dovey
- Re: half edge data structure
- From: broli
- half edge data structure
- Prev by Date: Re: polymorphic structs with "methods"
- Next by Date: Re: What's the deal with C99?
- Previous by thread: Re: half edge data structure
- Next by thread: Re: half edge data structure
- Index(es):
Relevant Pages
|