本帖最后由 xyp1964 于 2024-12-19 18:26 编辑
 - (defun abc (ptn dz)
- ;; (abc '((0 0 0) (0 0 100)(0 0 500)(0 0 1200)(0 100 200)(0 0 3200)(100 0 800)(0 500 400)) 400)
- ;; → (((0 0 0) (0 0 100) (0 100 200)) ((0 500 400) (0 0 500)) ((100 0 800)) ((0 0 1200)) ((0 0 3200)))
- (setq ptn (vl-sort ptn '(lambda (x y) (< (last x) (last y))))
- ptn (mapcar '(lambda (x) (list (fix (/ (last x) dz)) x)) ptn)
- )
- (mapcar '(lambda (x) (apply 'append (cdr x))) (xyp-Count1 ptn))
- )
|