Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm trying to extract a normal vector to a face that is constantly oriented with direction outside the body. If I don't understand wrong the data that I obtain from .normal is not consistent but depend if the face is generated by a tool (boolean operation) instead by normal operations on the face.
Someone know how to make this vector all the times pointing out or at least get a true/false variable that say to me if is oriented inside or outside?
def searchFaceAligned(bodies,vector):
for body in bodies:
facesModel=body.faces
searchEdge=True
rak=0
rakMax=facesModel.count
while searchEdge and rak<=rakMax:
faceModel=[]
faceModel=facesModel.item(rak)
rak+=1
facePlane=faceModel.geometry
if facePlane.objectType=="adsk::core::Plane":
faceNormal=facePlane.normal
if vector.isParallelTo(faceNormal):
searchEdge=False
isrev=faceModel.isParamReversed
angleZ=abs(vector.angleTo(faceNormal))
if angleZ<1:
if isrev:
inverse=True
else:
inverse=False
else:
if isrev:
inverse=False
else:
inverse=True
return faceModel, inverse
Solved! Go to Solution.