[Bf-committers] Proposal for new tri/quad face identification method

Ken Hughes khughes at pacific.edu
Thu Apr 13 07:50:06 CEST 2006


Cam and I (and Daniel and others) were discussing on IRC a problem which 
appeared in the Python Mesh/NMesh API.  Currently a 0 in v4 of a face 
indicates the face is a triangle, and a 0 in v3 is an error (the famous 
"eekadoodle").  In the editmesh code, if a face is added which uses 
vertex 0, checks are done to ensure it is either v1 or v2 and if not the 
face is reordered.

When appending a face in the Python API, this reordering occurs without 
notifying the user.  This causes a problem when they subsequently need 
to assign UV values to face vertices.  For import scripts (correct me if 
I'm wrong, Cam), it could slow down the script significantly if every 
face had to be checked prior to appending for v1 == 0 or v2 == 0.

Our discussion came up with two possible solutions:
(1) identify unused vertices with -1 (or UMAX_INT) instead of 0.  This 
would shorten the potential number of vertices for a mesh by 1 out of 2^32.
(2) add a flag bit which identified whether each face is a tri or quad. 
  This might cause a problem if eekadoodle cases still exist.

Ken


More information about the Bf-committers mailing list