找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2277|回复: 2

[求助]:问个菜鸟级的问题:怎么把一条AcDbCurve曲线按指定向量投影到平面上呢?

[复制链接]
发表于 2009-1-8 11:07:17 | 显示全部楼层 |阅读模式

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

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

×
请问怎么把一条AcDbCurve曲线按指定向量投影到平面上呢?
我在AcDbCurve类中看到了getOrthoProjectedCurve函数,但是它是沿平面的法向矢量向平面投影的函数,我现在是想根据指定的向量来向平面投影,该怎么做呢?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2009-1-8 14:34:58 | 显示全部楼层

Re: [求助]:问个菜鸟级的问题:怎么把一条AcDbCurve曲线按指定向量投影到平面上呢?

最初由 liucongkang12 发布
[B]请问怎么把一条AcDbCurve曲线按指定向量投影到平面上呢?
我在AcDbCurve类中看到了getOrthoProjectedCurve函数,但是它是沿平面的法向矢量向平面投影的函数,我现在是想根据指定的向量来向平面投影,该怎么做呢? [/B]


感觉你应该用virtual Acad::ErrorStatus getProjectedCurve而不是getOrthoProjectedCurve。


virtual Acad::ErrorStatus

getProjectedCurve(

const AcGePlane& unnamed,

const AcGeVector3d& projDir,

AcDbCurve*& projCrv) const;

unnamed Input plane onto which the curve is to be projected
projDir Input direction (in WCS coordinates) of the projection
projCrv Returns pointing to the newly created projected curve

This function creates a new curve entity that is the result of projecting the curve parallel to projDir onto the projPlane and sets projCurve to point to the newly created curve. projCurve is declared as type AcDbCurve in order to allow the returned curve to be any class derived from AcDbCurve. For example, when an AcDbArc is projected onto a plane, the result is an AcDbEllipse.

The returned curve is dynamically allocated, but has not been added to an AcDbDatabase yet. The application that calls this function is therefore responsible for its memory. If the curve is subsequently appended to a database, then the database takes over responsibility for its memory. Otherwise, the application is responsible for deleting it when it is no longer needed.

Returns Acad::eOk if successful. If projDir is perpendicular to the projPlane痴 normal then Acad::eInvalidInput is returned. For the AutoCAD built-in classes that use ShapeManager (AcDbEllipse, AcDbSpline, AcDbBody, AcDbRegion, and AcDb3dSolid), Acad::eGeneralModelingFailure is returned if an error occurs in the ShapeManager modeler. Other ErrorStatus values are implementation-dependent.

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

使用道具 举报

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-9 18:19 , Processed in 0.157391 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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