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

    Altitude/Azimuth of a face normal?

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    5 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.
    • A Offline
      AirWindSolar
      last edited by

      Looking for a way to find the altitude/azimuth for the yellow face in each circumstance, obviously relative to the root coordinate system and not the component's, since that would be constant throughout.

      Knowing the angle of the cut in the post, and the rotation angle, I'm certain there is a way to calculate this as well, but I don't recall how to do that either. (Pretty sure this wasn't covered in any of the math classes I've had.)

      Either method (measuring in SU or calculating from the known values) would help. Trial and error with the physical object can be tricky.


      AltAzExample.skp

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

        In View top with Parallel projection camera
        The protractor don't find that you want ?
        And what exactly do you want ?
        There are a number infinite of points on your Yellow surface ?

        http://wiki.naturalfrequency.com/files/wiki/shading/shadow-angles.gif

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

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

          Just a guess since I can't view the model because I'm stuck on SU2014. You should update your info to reflect that you are now using SU2016.

          Azimuth is the counter-clockwise angle measured from the +X axis.

          mod = Sketchup.active_model
          ent = mod.active_entities
          sel = mod.selection
          sel.grep(Sketchup;;Face).each{|fac|
          rpt = fac.bounds.center; nrm = fac.normal; rax = nrm.axes[0]
          tr = Geom;;Transformation.rotation(rpt,rax,Math.asin(nrm.z))
          nrm.transform! tr
          if nrm.x < 0
            azm = Math;;PI - Math;;asin(nrm.y) # Quadrant III or IV
          elsif nrm.y < 0
            azm = Math;;PI * 2 + Math;;asin(nrm.y) # Quadrant II
          else
            azm = Math;;asin(nrm.y) # Quadrant I
          end
          deg = azm.radians; deg=deg%360 ; d=deg.floor;
          m=((deg-d)*60).floor;s=(((deg-d)*3600)-m*60).round(2)
          ent.add_text "Altitude=#{rpt.z}\nAzimuth=#{d}#{176.chr} #{m}' #{s}\"",rpt,nrm
          }
          

          alt and azm.gif

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

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • A Offline
            AirWindSolar
            last edited by

            @sdmitch said:

            Azimuth is the counter-clockwise angle measured from the +X axis.

            Exactly, though I guess I should have been more clear on altitude; I mean in the sense of aligning an alt/az mount, so it would actually be pitch.

            I'll dig through that script and see if I can think clearly enough this morning to change that part over. Thanks for a heck of a good starting point, though; I was expecting it to take a lot more code than that just to get the azimuth right.

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

              @airwindsolar said:

              I should have been more clear on altitude; I mean in the sense of aligning an alt/az mount, so it would actually be pitch.

              The vertical angle(pitch?) measured from the +Z axis would be Math::acos(nrm.z)

              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