[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

duplicate vertices




bmg crew -- 

you've probably worked this out already, but
just a note on detecting dup'ed vertices.

there's no perfect way to do this, since there
may be cases in which two vertices, even though
extremely close together, are meant by the
designer to be distinct.  assuming such cases
are rare or non-existent, a good strategy is
to pass in a tolerance, in real units -- say,
0.25 inches -- and assume that vertices closer
than this should be merged.

one elegant way to do this is within the unigrafix
parser itself.  there is code there that handles 
vertex statements, defining a vertex with name (say) 
v1 at position x,y,z, by entering the name v1 into
a hash table, and associating v1 with coords x,y,z.

so the idea is to let this "first" vertex at x,y,z 
have the name "v1"; subsequent vertices, with 
different names but (nearly) identical x,y,z simply
hash to name v1, regardless of their name in the 
source file.

this nicely collapses all vertices near v1 to v1.