两条曲线的连接处会有问题,你的两个曲线不相连,过度之后会产生变化,即使相连的,两个端点的曲率不同,所以也会有偏差
- (defun c:test (;|ent1 ent2 |;/ ents1 ents2 lst1 lst2 knot-list controlpoint-list fit-list dxf70
- dxf71 dxf72 dxf73 dxf74)
- (setq ent1 (car (entsel)))
- (setq ent2 (car (entsel)))
- (setq ents1 (entget ent1))
- (setq ents2 (entget ent2))
- (setq knot-list nil)
- (setq lst1 ents1 lst2 ents2)
- ;Get all knot point
- (while (setq lst1 (member (assoc 40 lst1) lst1))
- (setq knot-list (append knot-list (list (car lst1))))
- (setq lst1 (cdr lst1))
- )
- (while (setq lst2 (member (assoc 40 lst2) lst2))
- (setq knot-list (append knot-list (list (car lst2))))
- (setq lst2 (cdr lst2))
- )
- (setq lst1 ents1 lst2 ents2)
- (while (setq lst1 (member (assoc 10 lst1) lst1))
- (setq controlpoint-list (append controlpoint-list (list (car lst1))))
- (setq lst1 (cdr lst1))
- )
- (while (setq lst2 (member (assoc 10 lst2) lst2))
- (setq controlpoint-list (append controlpoint-list (list (car lst2))))
- (setq lst2 (cdr lst2))
- )
- (setq lst1 ents1 lst2 ents2)
-
- (while (setq lst1 (member (assoc 11 lst1) lst1))
- (setq fit-list (append fit-list (list (car lst1))))
- (setq lst1 (cdr lst1))
- )
- (while (setq lst2 (member (assoc 11 lst2) lst2))
- (setq fit-list (append fit-list (list (car lst2))))
- (setq lst2 (cdr lst2))
- )
- (setq dxf70 (cons 70 8))
- (setq dxf71 (cons 71 (+ (cdr (assoc 71 ents1)) (cdr (assoc 71 ents2)))))
- (setq dxf72 (cons 72 (+ (cdr (assoc 72 ents1)) (cdr (assoc 72 ents2)))))
- (setq dxf73 (cons 73 (+ (cdr (assoc 73 ents1)) (cdr (assoc 73 ents2)))))
- (setq dxf74 (cons 74 (+ (cdr (assoc 74 ents1)) (cdr (assoc 74 ents2)))))
-
- (entmake (append
- (list '(0 . "SPLINE"))
- (list (cons 100 "AcDbEntity"))
- (list (cons 100 "AcDbSpline"))
- (list dxf70)
- (list dxf71)
- (list dxf72)
- (list dxf73)
- (list dxf74)
- knot-list
- controlpoint-list
- fit-list
- )
- )
- )
|