本帖最后由 yaojing38 于 2025-1-24 15:10 编辑
- (defun make-Ellipse (pt11 pt22 / dis pd pt0 pt33 pt44)
- (if (< (abs (- (cadr pt22) (cadr pt11))) (abs (- (car pt22) (car pt11)))) (setq pd t))
- (setq pt33 (polar pt11 (angle pt11 pt22) (/ (distance pt11 pt22) 2)))
- (setq dis (distance pt33 pt22))
- (setq pt0 (trans '(0. 0. 0.) 0 1))
- (if pd (setq pt44 (polar pt0 (* 0 pi) dis)) (setq pt44 (polar pt0 (* 0.5 pi) dis)) )
- (setq pt33 (trans pt33 1 0) pt44 (trans pt44 1 0))
- (entmake
- (list
- '(0 . "ELLIPSE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbEllipse")
- (cons 10 pt33)
- (cons 11 pt44)
- (cons 40 0.375787)
- (cons 41 0.0)
- (cons 42 6.28319)
- )
- )
- )
有时候我们只是需要一个简单的椭圆,分享下经验!有需要的可以自己研究下!
|