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

    Face Tilt

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    10 Posts 3 Posters 1.1k Views 3 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
      • pilouP Offline
        pilou
        last edited by

        Welcome
        Seems you have missed the Develpors section! πŸ˜‰
        http://sketchucation.com/forums/viewforum.php?f=180

        Frenchy Pilou
        Is beautiful that please without concept!
        My Little site :)

        1 Reply Last reply Reply Quote 0
        • pilouP Offline
          pilou
          last edited by

          Welcome
          Seems you have missed the Develops forum section! πŸ˜‰

          Frenchy Pilou
          Is beautiful that please without concept!
          My Little site :)

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

            @maryamr said:

            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

            For direction, are we talking about the clockwise or counter clockwise angle from North?

            Is tilt to be measured from vertical or horizontal.

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

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

              the tilt is to be measured from vertical i want to find the angle between the vertical line and the roof.

              'Orientation' I mean to get the direction of every face relative to the Red Axe, for example a face will have orientation of 90 degrees as it is perpendicular to the red axis.

              thank you

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

                @maryamr said:

                the tilt is to be measured from vertical i want to find the angle between the vertical line and the roof.

                'Orientation' I mean to get the direction of every face relative to the Red Axe, for example a face will have orientation of 90 degrees as it is perpendicular to the red axis.

                thank you

                In Sketchup, the red axis is East not North.

                That said, here is code that will give you the angles.

                mod = Sketchup.active_model
                ent = mod.active_entities
                sel = mod.selection
                faces = sel.grep(Sketchup;;Face)
                faces.each{|f|
                 if f.normal.z==0.0
                  ang=X_AXIS.angle_between(f.normal)
                 else
                  ang=Z_AXIS.angle_between(f.normal)
                 end
                 ent.add_text(Sketchup.format_angle(ang),f.bounds.center,f.normal)
                }
                

                angles.gif

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

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

                  thank you so much for your answer, this code works for C/C++ SDK in a C/C++ program or in Ruby ?
                  as i was all day finding just examples in Ruby and i've never used it before.

                  thnx

                  1 Reply Last reply Reply Quote 0
                  • sdmitchS Offline
                    sdmitch
                    last edited by

                    @maryamr said:

                    thank you so much for your answer, this code works for C/C++ SDK in a C/C++ program or in Ruby ?
                    as i was all day finding just examples in Ruby and i've never used it before.

                    thnx

                    Ruby only inside Sketchup I would guess.

                    Nothing is worthless, it can always be used as a bad example.

                    http://sdmitch.blogspot.com/

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

                      i meant the code u suggested is it for Ruby or C/C++ SDK ?

                      1 Reply Last reply Reply Quote 0
                      • sdmitchS Offline
                        sdmitch
                        last edited by

                        @maryamr said:

                        i meant the code u suggested is it for Ruby or C/C++ SDK ?

                        Ruby

                        Nothing is worthless, it can always be used as a bad example.

                        http://sdmitch.blogspot.com/

                        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