最初由 wang_tianyu 发布
[B]我想用一长度值来等分一条直线或曲线,然后将等分的点存在数组中,不知何汉书可以实现?请高手指点,谢谢! [/B]
AcDbCurve::getSplitCurves(...)
- virtual Acad::ErrorStatus
- getSplitCurves(
- const AcGePoint3dArray& points,
- AcDbVoidPtrArray& curveSegments) const;
- points Input array of points (in WCS coordinates) on the curve
- curveSegments Returns with pointers to newly created entities that are
- subcurves of the original
复制代码
你要仅仅得到这些点,而不是实际上把曲线断开,那么先求出曲线上度,然后除以等分数,每段的长度,然后循环下,利用:

- AcDbCurve::getPointAtDist Function virtual Acad::ErrorStatus
- getPointAtDist(
- double unnamed,
- AcGePoint3d& unnamed) const;
- unnamed Input distance along the curve from the beginning of the curve
- to the location of the desired point
- unnamed Returns the point located at the location specified by dist
- This function determines the point on the curve that is a distance of dist
- along the curve from the curve start, and returns the point in point. point is
- in WCS coordinates.
- Returns Acad::eOk if successful. If dist is not valid for the curve, then
- Acad::eInvalidInput is returned. Other ErrorStatus return values are
- implementation-dependent.
- The default implementation returns Acad::eNotImplemented.
|