两点中间
谁能帮我找到lisp中定义的两点之间的中点。谢谢和问候
维维安 (defun AT:Midpoint (p1 p2)
;; Midpoint between two points
;; Alan J. Thompson, 04.23.09
(mapcar (function (lambda (a b) (/ (+ a b) 2.))) p1 p2)
) 我在我的档案里有这个,我从来没有用过,我在起草时总是用MTP。
(defun c:FOO(/ pt1 pt2 mid)
(if (and (setq pt1 (getpoint "\n>>Specify first point: "))
(setq pt2 (getpoint "\n>>Specify second point: ")))
(progn
(prompt "\n<<The midpoint is: ")
(setq mid (mapcar '*
(mapcar '+ pt1 pt2)
'(0.5 0.5 0.5))))))
-大卫 非常感谢大家。
当做
维维安 如果它无法自行加载,您可以使用以下内容:
;;;MidPoint Between 2 Point Using CAL
;;;ARG -> 2 Points
;;;RET -> PointList
(defun midpt (p1 p2)
(cal "(p1+p2)/2"))
两点中间
(if (not (member "geomcal.arx" (arx))) (arxload "geomcal"))
矩形的中间
(if not lisp
(while in active command)
<Shift+right click> <Ctrl+right click> Mid between two points
)
只是玩玩而已
我一直认为GEOMCAL是Autocad的最佳插件之一,但大多数插件(包括我自己)都忽略了它。它有一些非常简洁的功能。 两点中间
(if not lisp
(while in active command)<Ctrl+right click> point filters
.xz mid mid)
)
只是玩玩(2)
“n”点的中点
(if not lisp
(while in active command)
M2P <click1> <click2> Mid between two points
)
页:
[1]
2