Grading - is it possible to use ratio instead of degrees for the slope value?

aridzv
edited August 2021 in 3D Modeling

Hi.
is it possible to use a ratio (like 3:1) instead of degrees for the slope value?
I'm looking for a way to avoid the need for ATAN(3:1),get the angle and copy-paste it, but to use the ratio directly.
thanks,
Ari.

Comments

  • If not possible, I think it should be.
    (From a user perspective)

  • I agree, this should be available. I've run into ratio slopes quite often, or percentage slopes though these are easy to convert to ratio slopes if necessary.


  • This routine uses Lee Mac GRDRAW.
    I use it a lot, many things can be tweaked



    (defun c:dii ( / x1 y1 z1 x2 y2 z2 p1 p2 d ducs dx dy dz v dxw dyw dzw w ax vprim vprimd axy )
    (while (not p1) (setq p1 (getpoint "\nPick or specify start point : ")))
    (while (not p2) (setq p2 (getpoint p1 "\nPick or specify end point : ")))
    (setq d (distance p1 p2))
    (grdraw p1 p2 6 1) ; halam
    (setq dx (car (setq v (mapcar '- p2 p1))))
    (setq dy (cadr v))
    (setq ducs (sqrt (+ (* dx dx) (* dy dy)))) ; halam
    (setq dz (caddr v))
    (setq dxw (car (setq w (mapcar '- (trans p2 1 0) (trans p1 1 0)))))
    (setq dyw (cadr w))
    (setq dzw (caddr w))
    (setq ax (cvunit (atan dy dx) "radians" "degrees"))
    (setq vprim (list (car v) (cadr v) 0.0))
    (setq vprimd (distance '(0.0 0.0 0.0) vprim))
    (setq axy (cvunit (atan (caddr v) vprimd) "radians" "degrees"))

    (prompt "\nDistance WCS : ")(princ (rtos d 2 50))
    (prompt "\nDistance UCS : ")(princ (rtos ducs 2 50))
    (prompt "\n\nDX in UCS : ")(princ (rtos dx 2 50))
    (prompt "\nDY in UCS : ")(princ (rtos dy 2 50))
    (prompt "\nDZ in UCS : ")(princ (rtos dz 2 50))
    (prompt "\n\nDX in WCS : ")(princ (rtos dxw 2 50))
    (prompt "\nDY in WCS : ")(princ (rtos dyw 2 50))
    (prompt "\nDZ in WCS : ")(princ (rtos dzw 2 50))
    (prompt "\n\nAngle around Z axis from X axis as 0.0 degree reference : ")(princ (rtos ax 2 50))(prompt " degrees")
    (prompt "\nAngle of picked points vector to XY plane : ")(princ (rtos axy 2 50))(prompt " degrees")
    (setq x1 (car p1) ; halam
    y1 (cadr p1) ; halam
    z1 (caddr p1)) ; halam
    (setq x2 (car p2) ; halam
    y2 (cadr p2) ; halam
    z2 (caddr p2)) ; halam
    (setq stringid1 (strcat "\nID pt1 : "(rtos x1 2 3) "," (rtos y1 2 3) "," (rtos z1 2 3))) ; halam
    (setq stringid2 (strcat "\nID pt2 : "(rtos x2 2 3) "," (rtos y2 2 3) "," (rtos z2 2 3))) ; halam
    (setq string1 (strcat "\n\nDistance UCS : " (rtos ducs 2 3)))
    (setq string2 (strcat "\nDX in UCS : " (rtos dx 2 3)))
    (setq string3 (strcat "\nDY in UCS : " (rtos dy 2 3)))
    (setq string4 (strcat "\nDZ in UCS : " (rtos dz 2 3)))
    (setq string5 (strcat "\nAngle in UCS plane : " (rtos axy 2 3) " degrees"))
    (setq string6 (strcat "\n"))
    (setq string7 (strcat "\nDistance WCS : " (rtos d 2 3)))
    (setq string8 (strcat "\nDX in WCS : " (rtos dxw 2 3)))
    (setq string9 (strcat "\nDY in WCS : " (rtos dyw 2 3)))
    (setq string10 (strcat "\nDZ in WCS : " (rtos dzw 2 3)))
    (setq string11 (strcat "\nAngle around Z axis as plane : " (rtos ax 2 3)" degrees"))
    (setq alertstring (strcat stringid1 stringid2 string1 string2 string3 string4 string5 string6 string7 string8 string9 string10 string11))
    (alert alertstring)
    (princ))
    (defun C:D () (c:dii)) ;halam