sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Triangle orientation

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 3.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • IltisI Offline
      Iltis
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • D Offline
        dezmo
        last edited by

        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

        Man can do everything. Only a matter of time and money.

        1 Reply Last reply Reply Quote 0
        • IltisI Offline
          Iltis
          last edited by

          Thank you very much for this explanation and for the special case.
          It helps a lot.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement