Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
OdDbSpline::toPolyline Method (OdDbCurve*&, bool, bool, int, int*, unsigned int)
Syntax
C++
OdResult toPolyline(OdDbCurve*& pCurve, bool bConvertAsArcs, bool bToLWPolyline, int precision = 10, int* maxSuggestedPrecision = NULL, unsigned int numOfVerticesThreshold = kPlineVerticesThrehold) const;

Generates a polyline to approximate a spline without using PLINETYPE and PLINECONVERTMODE. 

 

Parameters
Description
pCurve
[out] Pointer to newly created polyline entity.
bConvertAsArcs
[in] Indicating whether to convert to arcs or lines when spline is planar.
bToLWPolyline
[in] Indicating whether to convert to OdDbPolyline or OdDb2dPolyline when spline is planar.
precision
[in] Target precision value.
maxSuggestedPrecision
[out] (When not NULL) suggested precision value.
numOfVerticesThreshold
[in] Vertices threshold value.

Returns OdResult::eOk if successful; OdResult::eInvalidInput if numOfVerticesThreshold is too small.

The resulting curve can be OdDbPolyline, OdDb2dPolyline or OdDb3dPolyline. If at least one of the points of the spline does not lie on the XY plane, then an OdDb3dPolyline will be created from linear segments. If the spline is flat, then if bConvertAsArcs is true, the resulting polyline will be a segment of the arc, otherwise it will be line segments. And, if the spline is flat and bToLWPolyline is true, then the result will be OdDbPolyline, otherwise it will be OdDb2dPolyline. 

It is expected that the target precision will be from 0 to 99, but higher values are also acceptable. Negative precision means that maxSuggestedPrecision will be used to create a polyline. 

In the case where precision < 0, maxSuggestedPrecision will be used to create a polyline. In the case when the number of points of the generated curve is greater than numOfVerticesThreshold and maxSuggestedPrecision is not NULL, the maxSuggestedPrecision value will be calculated. If the precision value is good, then maxSuggestedPrecision will be -1.

Copyright © 2002-2022. Open Design Alliance All rights reserved.