سؤال

How do you write a Maxscript that gets the three points needed to create a face?

So you have your object, say it has 100 faces. Then the script should tell me which points form each face.

Also I'd like to know the angle two adjacent faces have to each other.

Thanks in advance

هل كانت مفيدة؟

المحلول

These are really two separate questions, but here goes:

This function will return an array consisting of a face index, and a point3 value depicting the indices of the vertices which create that face.

fn GetAllFaceVertices meshObj = 
(   
    for v = 1 to m.numVerts collect #(v, getFace v) 
)

This function will return an angle between two faces. It does so by getting the normal of each face and then return the arc cosine of the dot product of the two normals.

fn GetFaceAngles meshObj faceA faceB =
(
    local nA = getFaceNormal meshObj faceA
    local nB = getFaceNormal meshObj faceB
    acos (dot nA nB)
)

Note that both of these functions expect an editable mesh object. If you need to operate on an editable poly object, there are similar methods which use the polyop struct.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top