知識社群登入
draw a arc by CDR, C:圓心,D:方向, R:半徑
by 高顯忠, 2010-11-09 11:06, 人氣(2342)
(defun dtor(d1 / )
  (* (/ d1 180.0) pi)
  ); end of dtor()
; -----------------------------------------------

; draw a arc by CDR, C:圓心,D:方向, R:半徑
(defun c:arc-cdr( / pc p1 t1 t2 t3 p2 p3)
  (setq pc (getpoint "\n 弧的圓心: "))
  (setq p1 (getpoint "\n 大概的方向: "))
  (setq t1 (angle pc p1))

  (setq r1 (getdist "\n 輸入兩點 決定半徑: "))
  (setq t2 (+ t1 (dtor 15.0)))
  (setq t3 (- t1 (dtor 15.0)))

  (setq p2 (polar pc t3 r1))
  (setq p3 (polar pc t2 r1))
  (setq p1 (polar pc t1 r1))

  (command "arc" p2 p1 p3)
  (princ)
  ); end of c:arc-cdr