- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
AcDbPolyline has method onSegAt(). What menas double& (out) parameter param in the method?
Thanks.
Solved! Go to Solution.
AcDbPolyline has method onSegAt(). What menas double& (out) parameter param in the method?
Thanks.
Solved! Go to Solution.
All curves in AutoCAD are implemented as parameterized functions. They have a start parameter ps that defines the starting point and an end parameter pe that defines the endpoint. The curve is defined on the interval [ps,pe].
The baseclass of DB resident curves is AcDbCurve. AcDbPolyline is derived from AcDbCurve. These methods retrieve start- and end parameter and calculate a point on a curve for a given parameter:
Acad::ErrorStatus AcDbCurve::getStartParam(double &ps) const;
Acad::ErrorStatus AcDbCurve::getEndParam(double &pe) const;
Acad::ErrorStatus AcDbCurve::getPointAtParam(double param, AcGePoint3d &pt) const;
Vertex points of an AcDbPolyline have integer parameter values (0.0, 1.0, 2.0...). The parameter of a point is not the same as the curve length from the startpoint to the point. The ARX API has several functions to "convert" between point, parameter and path length.
Non DB resident curves work in a similiar way:
void AcGeCurve2d::getInterval(AcGeInterval& intrvl) const;
AcGePoint2d AcGeCurve2d::evalPoint(double param) const;
void AcGePoint3d::getInterval(AcGeInterval& intrvl) const;
AcGePoint3d AcGeCurve3d::evalPoint(double param) const;