Align Zaxis of plane to Azimuth and Altitude Coordinates
-
Hi.
Iām looking for help to have a plug-in that aligns the Zaxis of a plane to a pair of specific coordinates. The use will be:
a) Select a plane.
b) Input an Azimuth and Altitude coordinates, and the result would be:
c) The plane would turn itself to face that coordinates direction by aligning it's Zaxis to such direction.Azimuth and Altitude are two angular measurements and work as follows. Suppose we want to align the Zaxis of a plane to coordinates Azimuth 30Ā° and Altitude 50Ā°:
a) We have that plane pointing its Zaxis to a random direction (Fig.1). For clarity in explanation, in Fig. 1 the Zaxis is represented by a vector located at the center of the plane, and the intersection of the vector and the plane is at 0,0,0. Sketchup north is aligned with the green axis.
b) First, the Azimuth. The Zaxis Azimuth starts always aligned to Sketchup North, flat on the ground (fig. 2). North direction is 0Ā°, and starts to rotate towards East. So, when it reaches East it has rotated 90Ā°, when South 180Ā°, West 270Ā° and North 360Ā° or 0Ā° again. For our example, Zaxis turns to the East just 30Ā° (Fig. 3).
c) Then Altitude. Altitude is the angular measure the raises the Zaxis from the ground. For our example, Zaxis raises from the ground 50Ā° (Fig. 4).
Thatās it. Now the plane is facing Azimuth 30Ā° and Altitude 50Ā°.
Two last things. In this example north is the same as the green axis and the face is at 0,0,0, but it will not always be the case when using the plug-in. Thanks in advanced for any help.Javier
-
Hi and thanks for everybody who has taken the time to read my post. I'm not a programmer but would like to make this plug-in, so I'm wondering if someone can help me find similar plug-ins or codes that would help me understand and program it. Thanks.
-
This should get you started. I really can't help you more. It just happens, I am researching something similar, so familiar with the rotation commands. I am starting from your 2nd picture and assuming the plane normal is the green axis. The simple script just rotates whatever is selected with the assumed normal. About the origin, 30 deg and then 50 deg. So just select the parts, and type this into the ruby console to run the script (correct the path to where you have the script):
load 'c:/Rotate_Plane_example.rb'
-
Thanks Kyyu, will try it out right now.
Javier
@kyyu said:
This should get you started. I really can't help you more. It just happens, I am researching something similar, so familiar with the rotation commands. I am starting from your 2nd picture and assuming the plane normal is the green axis. The simple script just rotates whatever is selected with the assumed normal. About the origin, 30 deg and then 50 deg. So just select the parts, and type this into the ruby console to run the script (correct the path to where you have the script):
load 'c:/Rotate_Plane_example.rb'
Advertisement