get polygon by triangle

Hi there,

I have a simple problem, but can't find a simple solution. MeshProjIntersect.ClosestFace returns mesh face (triangle). Now since I'm working with editable poly, I need a poly face (polygon). Any idea how can I get that?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

Mesh triangle consists of three verts.
Given three vert indexes we can get polyfaces related to each of these verts.
Then we simply check which face is related to all of these three.

mfIndex = 42
mfVerts = getface meshObj mfIndex
pfIndex = (polyop.getFacesUsingVert polyObj mfVerts[1]) * (polyop.getFacesUsingVert polyObj mfVerts[2]) * (polyop.getFacesUsingVert polyObj mfVerts[3])

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.