Triangle orientation
-
Hello,
I'm creating faces with 3 points :
face = model.entities.add_face(pts)
Could you tell me if there is a way to know the orientation of the face according to the "direction of the rotation" between the 3 points?
Thank you very much.
Renaud. -
Looking at the face and the vertices order are clockwise you will see the back face.
So I assume you can determine the face normal direction according to points order, but it is depend of the viewpoint too...
You can test it e.g. if you put to ruby console:
Sketchup.active_model.active_entities.add_face([0, 0, 0],[0, 0, 1],[0, 1, 1])
check the orientation, delete and put this to check again:
Sketchup.active_model.active_entities.add_face([0, 1, 1],[0, 0, 1],[0, 0, 0])
Note that a special case exists for any face created on the ground plane, in which case the vertex order is ignored and the face is always facing down:
http://ruby.sketchup.com/Sketchup/Entities.html#add_face-instance_method -
Thank you very much for this explanation and for the special case.
It helps a lot.
Advertisement