明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 898|回复: 3

[已解答] vlax-curve-getParamAtPoint 这个函数返回值疑问

[复制链接]
发表于 2015-6-5 12:32 来自手机 | 显示全部楼层 |阅读模式
用圆弧测试得到法线的弧度
用直线测试得到距最近端点的距离
用多段线测试得到的是分段的序列+点在此分段的百分比
这个也太变化多端了吧
还是我理解的有误?
"觉得好,就打赏"
还没有人打赏,支持一下

本帖被以下淘专辑推荐:

发表于 2015-6-5 12:38 | 显示全部楼层
确实如此。椭圆也是,范围在0~2Pi
发表于 2015-6-5 12:45 | 显示全部楼层
好像有时候,椭圆的大于2Pi





;; Point -> Ellipse Parameter  -  Lee Mac
;; Returns the ellipse parameter for the given point
;; dxf  -  Ellipse DXF data (DXF groups 10, 11, 40, 210)
;; pnt  -  WCS Point on Ellipse
;; Uses relationship: ratio*tan(param) = tan(angle)

(defun LM:point->param ( dxf pnt / ang ocs )
    (setq ocs (cdr (assoc 210 dxf))
          ang (- (angle (trans (cdr (assoc 10 dxf)) 0 ocs) (trans pnt 0 ocs))
                 (angle '(0.0 0.0) (trans (cdr (assoc 11 dxf)) 0 ocs))
              )
    )
    (LM:ang0-2pi (atan (sin ang) (* (cdr (assoc 40 dxf)) (cos ang))))
)

;; Ang0-2pi  -  Lee Mac
;; Returns the supplied angle in the range 0-2pi rads

(defun LM:ang0-2pi ( a )
    (cond
        (   (equal (+ pi pi) a 1e-8) a)
        (   (minusp a) (LM:ang0-2pi (+ a pi pi)))
        (   (rem a (+ pi pi)))
    )
)
 楼主| 发表于 2015-6-5 17:10 来自手机 | 显示全部楼层
一直没搞清楚这个函数干什么用的
现在明白了
它的返回值可以做为其它函数的参数
比如vlax-curve-getfirstderiv
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-13 08:17 , Processed in 0.160465 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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