Scripting
Bobin John
Member Posts: 8
**
How do I search the faces of a body that is parallel to a certain plane in Scripting?
Tagged:
0
Answers
-
This is an example for getting faces in line with the X direction. Replace this with whatever vector you like.
def FaceIsXDirection(F, Tol=0.999): Dot = Vector.Dot(Direction.DirX.UnitVector, F.GetFaceNormal(0,0).UnitVector) return abs(Dot)>Tol XFaces=[] for B in GetRootPart().GetAllBodies(): for F in B.Faces: if FaceIsXDirection(F): XFaces.append(F) Selection.Create(XFaces).SetActive()
0 -
The above code works, which led me to another question - How would the code look if I need the faces that had a particular Y coordinate (say passing through Y=0.5)? This way I can select all faces parallel to a particular plane and also have a common coordinate in them.
0