Re: [心得] AutoCAD LISP 自問自答
; file: arc-h.lsp
(defun dtor(d1 / )
(* (/ d1 180.0) pi)
)
(defun c:arc-h( / )
(setq e1 (entsel "\n Please pick a Line for test: "))
(setq h (getreal "\n input H for test: "))
(setq h (* -1 h))
(setq p1 (cadr e1))
(setq p2 (osnap p1 "endp")
pm (osnap p1 "mid"))
(setq a1 (angle p2 pm))
(setq a2 (+ a1 (dtor 90.0)))
(setq p3 (polar pm a2 h)
p4 (polar pm a1 (distance p2 pm)))
(command "arc" p2 p3 p4)
(princ)
); end of c:arc-h
(princ "\n do the command of ARC-H")
(princ)
; end of file
※ 引述《sjgau (sjgau)》之銘言:
: 已知 P1, P2
: P1= X1, Y1
: P2= X2, Y2
: 是一個弧的兩個端點
: 弧的高度= H
: H 有正負之分
: H 又稱為 弦高
: 求作 這個弧
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.245.109.38
討論串 (同標題文章)
Cad_Cae 近期熱門文章
PTT數位生活區 即時熱門文章