PDA

View Full Version : How are polySplit face indices determined?

 mrredsun09-28-2005, 11:02 PMI'm scripting the polySplit tool to slice up a polygon, but I need to know what each index of the new faces will be after they are split. Does anyone know how I can determine which face will retain its index and which faces will receive a new index (and in which order)? Thanks for any assistance.
john_homer
09-29-2005, 02:24 AM
perhaps I dont understand the question... so exsuse me if this is too basic..

but if you create new faces then they will be the "last".
so if you have a surface.. and run `polyEvaluate -f` it gives the number of faces (lets say 20) then you do your splittin', then `polyEvaluate -f` again and get the new face count (say 30), then the new faces are the last 10 of 30, which is surfaceName.f[19:29]

hope that helps

.j

mrredsun
09-29-2005, 06:22 PM
Thanks for the help john_homer, but I eventually found the answer. I'll explain it a bit more clearly in case any one else comes up against this.

If I have a polygon with only one face (face[0]) and I polySplit that into two pieces, I would want to predict which part of that split face will remain face[0] and which one becomes face[1]. Then, when I polySplit face[0] again, I would want to determine which part remains face[0] and which part becomes face[2].

The method Maya uses to determine how faces are indexed after a polySplit is based on the direction of the cut. If the direction of the cut is considered the up vector, then the face on the left side of it will retain its index while the face on the right side will receive the new value. I'm still not quite sure how exactly the indexing works when one face is polysplit into more than two pieces, but I think it starts on the left of the up vector, then indexes the face to the right, then looks for the next face to the left of the up vector and so forth.

CGTalk Moderation
09-29-2005, 06:22 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.