- UID
- 5126
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-16
- 最后登录
- 1970-1-1
|
发表于 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. |
|