Re: [八六] 借我放
;trod.lsp
(defun tr (ip p0 r1 r2 /)(tr0 ip p0 r1 r2 t t t)(princ))
(defun tu (ip p0 r1 r2 /)(tr0 ip p0 r1 r2 t t nil)(princ))
(defun tm (ip p0 r1 r2 /)(tr0 ip p0 r1 r2 nil t t)(princ))
(defun 2tl (ip p0 r1 r2 /)(tr0 ip p0 r1 r2 nil t nil)(princ))
(defun pr (ip p0 r /)(tr0 ip p0 r r t t t)(princ))
(defun pu (ip p0 r /)(tr0 ip p0 r r t t nil)(princ))
(defun pm (ip p0 r /)(tr0 ip p0 r r nil t t)(princ))
(defun 2pl (ip p0 r /)(tr0 ip p0 r r nil t nil)(princ))
;============================================================
(defun C:tr (/ ip p0 r1 r2)
(graphscr)
(if (and (setq ip (getpoint "\nInput insertion point <exit>:"))
(setq p0 (getpoint ip "\nInput the end point <exit>:"))
(setq r1 (getdist ip "\nInput first radius <exit>:"))
(setq r2 (getdist p0 "\ninput second radius <exit>:"))
)
(progn (tr0 ip p0 r1 r2 t t t)
))
(princ)
)
;============================================================
(defun tr0 (ip p0 r1 r2 f1 f2 f3 / p1 p2 p3 p4 th1 th2 th3)
(setq th1(angle ip p0)
th2(+ th1 (/ pi 2.0))
th3(- th2 pi)
p1(polar ip th2 r1)
p2(polar ip th3 r1)
p3(polar p0 th2 r2)
p4(polar p0 th3 r2)
)
(if (and (not (equal r1 0.0 0.0001)) f1)
(progn
(command "line" p1 p2 "")
)
)
(if (and (not (equal (distance p1 p3) 0.0 0.0001)) f2)
(progn
(command "line" p1 p3 "")
(command "line" p2 p4 "")
)
)
(if (and (not (equal r2 0.0 0.0001)) f3)
(progn
(command "line" p3 p4 "")
)
)
(princ)
)
---
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.46.19
討論串 (同標題文章)
完整討論串 (本文為第 2 之 8 篇):
八六