How can I convert 3 selected vert. to 1 face?
Is this in EditableMesh or EditablePoly?
In EditableMesh for example, you could use the meshop.getFacesUsingVert() for each vertex and then figure out which face all 3 share:
fn getFaceByVerts theMesh theVerts =
(
f1 = meshop.getFacesUsingVert theMesh theVerts[1] --get faces used by vertex 1
f2 = meshop.getFacesUsingVert theMesh theVerts[2] --get faces used by vertex 2
f3 = meshop.getFacesUsingVert theMesh theVerts[3] --get faces used by vertex 3
(f1*f2*f3) as array --get intersection of the 3 bitarrays, return as array
)
theMesh = snapshotAsMesh $Box01 --snapshot a box as mesh
theFaces = getFaceByVerts theMesh #(1,2,4) --call the function asking for verts 1,2,4
--print the result:
if theFaces.count > 0 then
format "Here are the faces: %\n" theFaces
else
format "No Faces found.\n"
Calling the same for #(1,2,3) returns "No Faces found", because the Box does not have a face used by these vertices.
You can do the same for EPoly using the corresponding PolyOp. function...
Cheers,
Bobo
CGTalk Moderation
02-26-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.