本帖最后由 xyp1964 于 2024-1-24 22:29 编辑
- (defun xyp-StrSpr (str sub / lst n)
- "以指定分解符分解字符串"
- (if (/= sub "")
- (progn
- (while (setq n (vl-string-search sub str))
- (setq lst (cons (substr str 1 n) lst)
- str (substr str (+ n (strlen sub) 1))
- )
- )
- (vl-remove "" (reverse (cons str lst)))
- )
- )
- )
- (defun xyp-PtInPtn (p pt / aa)
- "xyp-PtInPtn 点在点集内 (xyp-PtInPtn pt点 ptn点集)"
- (setq aa (mapcar '(lambda (x y) (rem (- (angle x p) (angle y p)) pi)) pt (cons (last pt) pt))
- aa (abs (apply '+ aa))
- )
- (equal aa pi 1e-8)
- )
|