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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement