成仔 发表于 2012-9-13 08:17:43

占个位置,以后要用就好找了

hhh454 发表于 2012-9-13 08:45:52

论坛里有相关的代码,找找应该有

dybsy 发表于 2013-1-7 16:26:54

非常有用啊 谢谢!!!版主 谢谢网站!

阿然 发表于 2013-1-7 18:55:02

本帖最后由 阿然 于 2013-1-7 18:56 编辑

给个lee大的函数
参数是图元表(vla-object)
返回包围框的左下角和右上角点坐标


;;------------------=={ List BoundingBox }==------------------;;
;;                                                            ;;
;;Returns the coordinates of a rectangle framing all      ;;
;;objects in a supplied list                              ;;
;;------------------------------------------------------------;;
;;Author: Lee Mac, Copyright ?2010 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;Arguments:                                                ;;
;;lst - list of VLA-Objects to process                      ;;
;;------------------------------------------------------------;;
;;Returns:coordinates of rectangle framing objects      ;;
;;------------------------------------------------------------;;
(defun LM:ListBoundingBox ( lst / ll ur bb )
;; ?Lee Mac 2010
(foreach obj lst (vla-getBoundingBox obj 'll 'ur)
    (setq bb (cons (vlax-safearray->list ur)
                   (cons (vlax-safearray->list ll) bb))
    )
)
(mapcar
    (function
      (lambda ( operation )
      (apply (function mapcar) (cons operation bb))
      )
    )
   '(min max)
)
)
;;----------------=={ BoundingBox -> List }==-----------------;;
;;                                                            ;;
;;Returns the coordinates of a rectangle from the         ;;
;;coordinates of the lower-left and upper-right corners   ;;
;;------------------------------------------------------------;;
;;Author: Lee Mac, Copyright ?2010 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;Arguments:                                                ;;
;;bbox - list of lower-left and upper-right coordinates   ;;
;;------------------------------------------------------------;;
;;Returns:coordinates of rectangle                        ;;
;;------------------------------------------------------------;;
(defun LM:BBox->List ( bbox )
(mapcar
    (function
      (lambda ( funcs )
      (mapcar
          (function
            (lambda ( func ) ((eval func) bbox))
          )
          funcs
      )
      )
    )
    '((caarcadar)(caadr cadar) (caadr cadadr) (caarcadadr))
)
)


yxh1202 发表于 2013-1-7 19:18:18

阿然 发表于 2013-1-7 18:55 static/image/common/back.gif
给个lee大的函数
参数是图元表(vla-object)
返回包围框的左下角和右上角点坐标

能不能改个思路,就是选择集中图元的交点形成的不规则包围圈用多线段标记出来呢,这个很有用。希望高人指点

阿然 发表于 2013-1-7 20:12:52

本帖最后由 阿然 于 2013-1-7 20:25 编辑

yxh1202 发表于 2013-1-7 19:18 http://bbs.mjtd.com/static/image/common/back.gif
能不能改个思路,就是选择集中图元的交点形成的不规则包围圈用多线段标记出来呢,这个很有用。希望高人指 ...

参考高飞大的凸包计算方法,
所有交点论坛上也有程序,见链接
http://bbs.mjtd.com/thread-85947-1-1.html

start4444 发表于 2017-11-3 18:59:09

学习了

diditoy 发表于 2018-5-2 15:38:28

占个位,回头研究研究。
页: 1 [2]
查看完整版本: 怎么用lisp画出选择集的外围线