FWIW找到相反的点:
- (defun OppositePtOnCurve ( curve p / dis )
- (vlax-curve-getPointAtDist curve
- (rem
- (+
- (vlax-curve-getDistAtPoint curve p)
- (* 0.5 (setq dis (vlax-curve-getDistAtParam curve (vlax-curve-getEndParam curve))))
- )
- dis
- )
- )
- ); defun OppositePtOnCurve
测试功能:
- (
- (lambda (x / args p2)
- (and x
- (setq args (cons (car x) (list (apply 'vlax-curve-getClosestPointTo (append x '(t))))))
- (setq p2 (apply 'OppositePtOnCurve args))
- (entmakex (list (cons 0 "LINE")(cons 10 (cadr args))(cons 11 p2)))
- )
- )
- (nentselp "\nPick a closed curve:")
- )
|