明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 620|回复: 2

[提问] 知道椭圆信息 求椭圆上一点的41 42码

[复制链接]
发表于 2021-7-6 00:19:29 | 显示全部楼层 |阅读模式
本帖最后由 timmy521 于 2021-7-6 09:43 编辑

如题 ,可以通过lisp获取椭圆上的所有参数 ,现在知道 椭圆上任意一点   怎么求该点的绘图参数啊  我用endpoint进行测试,结果得不到
(defun c:t1()
   (vl-load-com)
   (setq name (car (entsel)))
   (Setq cen (Vlax-Get (Vlax-Ename->Vla-Object name) 'Center ))
   (Setq pt(Vlax-Get (Vlax-Ename->Vla-Object name) 'EndPoint ))

   (Setq axis (Vlax-Get (Vlax-Ename->Vla-Object name) 'MajorAxis ))
   (Setq ratio (Vlax-Get (Vlax-Ename->Vla-Object name) 'RadiusRatio ))
  (setq endparam (Vlax-Get (Vlax-Ename->Vla-Object name) 'EndParameter)
  (pt2ep ptend  cen axis ratio)


)
(princ "\n程序加载完成")
(princ "\n")

(defun pt2ep (pt cen axis ratio / ang param)
(setq ang (- (angle cen pt) (angle '(0. 0. 0.) axis)))
(setq param (atan (sin ang) (* (cos ang) ratio)))
(if (< (cos ang) 0.0)
  (setq param (+ pi param))
)
param
)


发表于 2021-7-6 08:02:08 | 显示全部楼层
不懂这是个什么玩法
 楼主| 发表于 2021-7-6 09:57:37 | 显示全部楼层
(princ (vlax-curve-getParamAtPoint obj1 pt ))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-16 18:32 , Processed in 0.180132 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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