马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun XD::Pnts:Extremum (pts xoper yoper mode / box gx gy x y)
- (setq box (xdrx_points_box pts)
- gy (xdge::constructor "kLineseg3d" (car box) (cadr box))
- gx (xdge::constructor "kLineseg3d" (car box) (last box))
- )
- (setq pts (cdar (vl-sort (xd::list:groupbyindex (mapcar
- '(lambda (x)
- (list
- (xdge::getpropertyvalue (if mode gy gx) "distanceto" x)
- x
- )
- )
- pts
- ) 1e-3
- ) '(lambda (x y)
- (if mode
- (apply yoper (list (car x) (car y)))
- (apply xoper (list (car x) (car y)))
- )
- )
- )
- )
- )
- (setq pts (mapcar
- 'cadr
- (vl-sort (xd::list:groupbyindex (mapcar
- '(lambda (x)
- (list
- (xdge::getpropertyvalue (if mode gx gy) "distanceto" x)
- x
- )
- )
- pts
- ) 1e-3
- ) '(lambda (x y)
- (if mode
- (apply xoper (list (car x) (car y)))
- (apply yoper (list (car x) (car y)))
- )
- )
- )
- )
- )
- (xdge::free gx gy)
- (car pts)
- )
|