作者sjgau (sjgau)
看板Cad_Cae
标题Re: [心得] AutoCAD LISP 自问自答
时间Thu Jul 16 16:44:22 2009
; 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