Altitude/Azimuth of a face normal?
-
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.
-
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 ? -
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 }
-
@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.
-
@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)
Advertisement