If I understood correctly, you don't know how to obtain angle of projection on plan view of bend that was rotated along horizontal axis down by alpha degree starting from vertical position of 90 degree... If you look from side where axis of rotation is viewed in special position as point, you will see bend as line that when rotates makes circle... If you rotate from vertical position by alpha, your horizontal projection would be L*cos(alpha), vertical L*sin(alpha), where L is projection length of bend in our special projection view, and if bend is bended at 45 degree as shown in attached file, after some calculations, I've found :
Code:
(defun c:hpa-ra () (c:hprojang-rotang) )
(defun c:hprojang-rotang ( / alpha gamma gammar)
(setq alpha (getangle "\nInput angle in decimal degrees for rotation of bend along main pipe axis : "))
(setq gammar (- PI (atan (cos (- (/ PI 2) alpha)))))
(setq gamma (* (/ 180 PI) gammar))
(princ "Horizontal projection angle is : ")(princ gamma)(princ " degrees")
(princ)
)
(princ "\nType \"hpa-ra\" for shortcut")
(princ)
This only works for bend of 45 degrees...
This works for all curvatures of bend pipes :
Code:
(defun c:hpa-ra () (c:hprojang-rotang) )
(defun c:hprojang-rotang ( / alpha beta v-h gamma gammar)
(setq beta (getangle "\nInput angle in decimal degrees for curvature of bend of pipes : "))
(setq v-h (/ (sin beta) (cos beta)))
(setq alpha (getangle "\nInput angle in decimal degrees for rotation of bend along main pipe axis : "))
(setq gammar (- PI (atan (* v-h (cos (- (/ PI 2) alpha))))))
(setq gamma (* (/ 180 PI) gammar))
(princ "Horizontal projection angle is : ")(princ gamma)(princ " degrees")
(princ)
)
(princ "\nType \"hpa-ra\" for shortcut")
(princ)
M.R.