- UID
- 151438
- 积分
- 440
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-6-21
- 最后登录
- 1970-1-1
|
发表于 2004-10-5 23:34:52
|
显示全部楼层
对不同类型的曲线,param代表的意义不尽相同,但肯定不是斜率。
Doug Broad 有这段回复,希望对你有用,他没有解释spline,但据我观察,对spline来说,param值和knots属性值有关。我觉得param参数只是起一个过渡作用,没有必要深究其几何意义。制定的人可能也是图个方便,对各种曲线找出一种单调对应的关系就行。当然也方便使用者的理解,比如对园来说param是从0到2*pi就是对应圆周角度。下面是Doug Broad对Mark类似问题的答复。
Re: What is a param? as in vlax-get-param-xxx
Mark,
If you want to stay with activeX,
1. The parameter for any point on an arc is the angle of the ray in
radians drawn from the center of the arc to that point with east being
0.
For a line, the start param is 0, the end param is its length
For a polyline, the start param is 0, the end param is the number
of verticies-1.
For a circle, the start param is 0 and the end param is 2*pi.
2. To get the start param for an arc use:
(setq arcstartparam (vlax-curve-getparamatdist <arcobject> 0))
or
(setq arcstartparam(vlax-curve-getstartparam <arcobject>))
3. To get the first derviative (slope of the arc) at that point, use
(setq arcstartslope (vlax-curve-get-firstderiv <arcobject> arcstartparam)
The return value is a pseudo vector (sort of a deltax, deltay, deltaz).
I am not sure what the exact quantities mean. For instance,
(vlax-curve-get-firstderiv <arcobject> 0) would give ( 0.0 <positive number> 0.0)
4. To get the start point of the arc (in list form)
(vlax-curve-getpointatparam <arcobject> startparam)
or
(vlax-get <arcobject> "startpoint")
or
(vlax-safearray->list(variant-value(vla-get-startpoin t <arcobject>)))
5. To get the other endpoint of the line, use
(polar <startpt> (+ pi (atan (car <firstderiv>) (cadr <firsderiv>))) <linelength>)
To use regular command methods to draw the stuff is much simpler. For
instance, hitting the return for the first prompt in the line command after
an arc, locks the line tangent to the end of the arc. You need only enter
the distance.
(command "arc" <start> "c" <center> <end> "line" "" <length> "") |
|