collecting Faces with same Normals...
Hi!
I want to loop over all faces and collect those who have same normal into an array then append this one to an other array..
for exemple in the image I shawn it is a simple cube as you see face 1,2,3,4 have same normal 5,6,7,8 have same normal...Iwant to obtain 2D array like this...
((1,2,3,4),(5,6,7,8)....)
I couldn' fin a good algo to do this...since the face normal is unknow...before loop...especilally on a complex object...that have a lot of differents normals, any Ideas how to do this?
Attachment | Size |
---|---|
untitled_camera01_0f.jpg | 265.46 KB |
Comments
I would use this method -
I would use this method - i.e. collect string addresses of face normals as you go (or maybe names instead of strings, pick one). When that address already exists, use the corresponding subarray (although I'd suggest using bitarrays here), if not, store the address and a new subarray.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters