Start a new topic

reversing faces in -z

this is from my last script that seemed to be working but i ran into a model with a face in +z and in -z. 

Im not really sure if what im trying to do here is right at all.

this is run on a few footprint polygons facing +z. i want this to select them all and reverse them and if there are polys already facing -z, leave them alone

i was thinking the k == 1 meant the polys that are facing +z would be selected and reversed

 


def findHiddenPolys ( db, parent, rec , counter):

type = mgGetCode (rec)

if ( type == fltPolygon ): 

outs = mgGetAttList (rec, fltPolyHidden) 

if (outs[2] == 1):

counter.match_list.append (rec)

counter.count = counter.count + 1

mgDeselectAll(db)

for rec in counter.match_list:

b,i,j,k = mgGetPolyNormal(rec)

if k == 1:

mgSelectOne(rec)

mgExecute("Reverse Face",None)

return MG_TRUE

return MG_TRUE


mgWalk(db,findHiddenPolys, None, counter, MWALK_NEXT)



1 Comment

sorry, this posted twice, i had a page show up saying something went wrong and someone was notified???

Login to post a comment