- 积分
- 1438
- 明经币
- 个
- 注册时间
- 2004-1-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
请教:这是一个在x,方向上非线性放大圆思路,因为知识有限,请大虾们帮忙修改。谢谢!
这个非线性方程是关于同样纵坐标下,圆上两点横坐标的差值(它是变量,即不同的y,差值不同)。
(DEFUN testbb (/ obj circle )
(vl-load-com)
(SETQ obj (VLAX-ENAME->VLA-OBJECT (CAR (ENTSEL "\nPick the circle: "))))
(setq rad (vla-get-radius obj));get the radius of circle
(setq cen (vla-get-center obj));here center is (0,0,0)
(setq pt (vla-get-point circ-obj);get the points of circle
if for (cadr pt(i))=(cadr pt(+(i)n);for the same y coordinate of two different points on circle
(setq leng ( ABS(-(car pt(i))(car pt(+(i)n)))));calculate the subtraction of their x coordinates
(setq leng1 (+(expt leng 2)1);bring the subtraction into nonlinear function to largen
(setq newx (/ leng1 2);then divide by 2
(setq newx1 (- newx)
(vlax-put-property newx1 (car pt(i));take above value as new x coordinates of that two points,put back negative one to point1
(vlax-put-property newx (car pt(+(i)n)));put back positive one to point2
;Here short of one line: according to those points,get a polyline.
(command "_.extrude" (entlast) "" z "");extrude the polyline at a height to get cylinder
(PROMPT "\nBlock has been scaled.")
(PRINC)
)
|
|