明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2343|回复: 0

x方向上非线性放大圆思路,请帮忙修改,谢谢!

[复制链接]
发表于 2004-1-23 15:49:00 | 显示全部楼层 |阅读模式
x方向上非线性放大圆思路,请帮忙修改,谢谢!
请教:这是一个在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)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-23 17:33 , Processed in 0.172152 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表