本帖最后由 nzl1116 于 2013-8-1 12:27 编辑
wowan1314 发表于 2013-8-1 11:45 
请指教,你给的函数我都没看明白呢。 如果可以请给讲解下吧?  - (defun GetAllPath (SPnt PntLst / PtLst0 PtLst1)
- (setq PtLst1 (vl-remove-if-not
- (function (lambda (x) (member SPnt x)))
- PntLst
- ) ;_ 所有包含SPnt点的点对表
- PtLst0 (vl-remove SPnt (apply 'append PtLst1)) ;_ 和点SPnt相连的所有点
- )
- (cond
- ((not SPnt) nil)
- ((not PtLst0) (list (list SPnt)))
- ;;核心代码,批量递归
- (T
- (mapcar
- (function (lambda (x) (cons SPnt x)))
- (apply
- 'append
- (mapcar
- 'GetAllPath
- PtLst0
- (mapcar (function (lambda (x) (vl-remove x PntLst))) PtLst1)
- )
- )
- )
- )
- )
- )
|