找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 676|回复: 6

[求助]:各位,请帮我看看如下函数如何实现!谢谢!!!

[复制链接]
发表于 2004-3-3 18:42:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
谁能帮我实现如下函数:
void getDerivOnGeCurve(const AcGeCurve2d * pGeCurve,const AcGePoint2d& point,AcGeVector2d& deriv)
其中,第二个参数为曲线外的一点。
函数功能:求算已知曲线上某点的切向量或者法向量!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 593个

财富等级: 财运亨通

发表于 2004-3-3 18:55:45 | 显示全部楼层
VLAX都有这个函数ARX还要求?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-3-4 09:37:29 | 显示全部楼层
下面摘自ObjectARX的帮助:
virtual Acad::ErrorStatus
getFirstDeriv(
    double param,

    AcGeVector3d& firstDeriv) const;

param        Input parameter of location on curve at which to find the first derivative
firstDeriv        Returns the first derivative of the curve at param

Here and in derived classes, this function is implemented to evaluate the first derivative at the location on the curve specified by param, and sets firstDeriv to the result (in WCS coordinates).
Returns Acad::eOk if successful. If param is not valid for the curve, then Acad::eInvalidInput is returned. Other ErrorStatus return values are up to the implementor.
For implementation, the AcGe classes may provide some of the necessary functionality to make the job easier.

The default implementation returns Acad::eNotImplemented.

virtual Acad::ErrorStatus

getFirstDeriv(
    const AcGePoint3d& point,

    AcGeVector3d& firstDeriv) const;

point        Input point on curve at which to find the first derivative
firstDeriv        Returns the first derivative of the curve at point

This function evaluates the first derivative of the curve at point and sets firstDeriv to the result, in both this class and derived classes. Both point and firstDeriv are in WCS coordinates in derived classes.
Returns Acad::eOk if successful. If point is not on the curve, then Acad::eInvalidInput is returned. Other ErrorStatus return values are up to the implementor.
For implementation, the AcGe classes may provide some of the necessary functionality to make the job easier.

In the default implementation, the function returns Acad::eNotImplemented.
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-3-4 18:46:27 | 显示全部楼层
eachy 斑竹不知您是何意? 能否讲的详细些?

PLgis 兄,我的第一个参数是:“const AcGeCurve2d * pGeCurve”,不是AcDbCurve !
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 593个

财富等级: 财运亨通

发表于 2004-3-4 20:31:19 | 显示全部楼层
最初由 DARCY 发布
[B]eachy 斑竹不知您是何意? 能否讲的详细些?

PLgis 兄,我的第一个参数是:“const AcGeCurve2d * pGeCurve”,不是AcDbCurve ! [/B]

Sorry,俺对ARX一窍不通,我说的是两个VLAX函数

vlax-curve-getsecondderiv
语法

    (vlax-curve-getSecondDeriv curve-obj  param)

功能

     返回曲线在指定位置的二阶导数(在 WCS 中)。

 

说明

1)参数 curve-obj 为要测量的 VLA 对象。

2)参数 param 为数值,指定曲线上的参数。

返回值:

若成功则返回三维矢量表,否则返回 nil。

范例

假定 splineObj 指向 vlax-curve-getDistAtParam 范例中的样条曲线。

1)获取曲线的开始参数:

_$ (setq stparameter (vlax-curve-getStartParam splineObj))

0.0

2)获取曲线的结束参数:

_$ (setq endparameter (vlax-curve-getEndParam splineObj))

18.2920

3)确定沿曲线中点参数的二阶导数:

_$ (vlax-curve-getSecondDeriv splineObj  

   ( / (- endspline startspline) 2))  

(0.0365863 0.256155 0.0)

vlax-curve-getfirstderiv

语法

      (vlax-curve-getFirstDeriv curve-obj param)

功能

     返回曲线在指定位置的一阶导数(在 WCS 中)。

说明

1)参数 curve-obj 为要测量的 VLA 对象。

2)参数 param 为数值,指定曲线上的参数。

返回值:

若成功则返回三维矢量表,否则返回 nil。

范例

假定 splineObj 指向 vlax-curve-getDistAtParam 范例中的样条曲线。

1)使用 vlax-curve-getStartParam 获取曲线的开始参数:

_$ (setq stparameter  (vlax-curve-getStartParam splineObj))

0.0

2)获取曲线的结束参数:

_$ (setq endparameter (vlax-curve-getEndParam splineObj))

18.2920

3)确定沿曲线中点参数的 一阶导数:

_$ (vlax-curve-getFirstDeriv splineObj  

   ( / (- endparameter stparameter) 2))

(0.622631 -3.25251 0.0)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2004-3-5 00:49:19 | 显示全部楼层
楼主问的是求AcGe“几何实体模型”的求一阶导数,AcGe几何库都提供了完备的方法,直接就有,不用自己写。

一般能够需要的,AcGe都提供了,多查查帮助文件里面本类提供的方法或者它的父类的方法。

AcGe几何库是使用ARX开发最方便和高效的地方,提供了ACAD里面所有实体对应的数学模型,利用模型(不用生成实体)就可以得到几何实体的各种属性和图形算法。

[php]


AcGePoint2d

evalPoint(

double param,

int numDeriv,

AcGeVector2dArray& derivArray) const;

param Input parameter value at which curve is to be evaluated

numDeriv Input highest derivative order requested

derivArray Output derivatives. derivArray[0] is first derivative, and so on.


Returns the point on the curve that corresponds to the input parameter

value. Also returns the number of derivative vectors that are specified in

numDeriv. The numDeriv parameter should not be set larger than 2.


[/php]

上面你给出求的阶数参数numDeriv,一阶导数、二阶导数结果会保存到AcGeVector2dArray数组里面。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-3-6 10:00:02 | 显示全部楼层
谢谢各位的帮助! 尤其是斑竹。
是我忽视了这个函数:)我只注意到:AcGePoint2d evalPoint(double param)函数,以为只能得到点坐标!结果想歪了!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-22 16:50 , Processed in 0.315459 second(s), 43 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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