本帖最后由 Zrrrrr 于 2020-6-13 20:19 编辑
看了半天还是没看懂。我是从Lee-Mac的求垂足的程序过来的,和高飞兄最后一个妙用的例子应该类似的。但研究了半天能力有限,只能拿来主义了。。此处附上Lee-Mac的源代码,供大家参考:
 - ;; Project Point onto Line - Lee Mac
- ;; Projects pt onto the line defined by p1,p2
- (defun LM: ProjectPointToLine ( pt p1 p2 / nm )
- (setq nm (mapcar '- p2 p1)
- p1 (trans p1 0 nm)
- pt (trans pt 0 nm)
- )
- (trans (list (car p1) (cadr p1) (caddr pt)) nm 0)
- )
|