sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Face Tilt and orientation

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 758 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.
    • M Offline
      MaryamR
      last edited by

      http://cdn2.tinyhousedesign.com/wp-content/uploads/2009/02/tiny-simple-house-2-450x406.png

      i'am new to Sketchup C/C++ SDK. I am creating a C/C++ program which gives me the geometry of a house model in Sketchup.I want to get the orientation of all the faces in the model and their Tilt. When I say the word 'Orientation' I mean to get the direction of every face relative to the N direction using the Axes in Sketchup and when i say Tilt i mean the degree of each face' tilt in the grey roof in this example.

      Can anyone come up with a solution or a method to do that?

      Thanks in advance

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Using SUFaceGetNormal you get the face orientation in relationship to its parent entities container.
        Not sure what you mean by "N direction" though..?

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • M Offline
          MaryamR
          last edited by

          i didn't quite understand how can i do get the orientation,as it's my first time using Sketchup C/C++ SDK.

          i meant by "N direction" an axe, for example find faces orientation using one axe red one for example as reference, because i need the degree of orientation.

          do u have an example of how to find the orientation ?

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            As you traverse the entities and you have a SUFaceRef:

            
            // Assuming `face` is a SUFaceRef.
            SUVector3D vector = { 0.0, 0.0, 0.0 }
            SUFaceGetNormal(face, &vector);
            
            

            You can then inspect the X, Y and Z values of the vector to see if it's facing the direction you are looking for.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • M Offline
              MaryamR
              last edited by

              What i'm looking for is the degree of the angle between the face (wall for example) and the red axe and have that angle degree for each face,for example face 1 20°, face 2 80° ...

              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