Close

Relief for ODA Team in Ukraine

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

Generates a polyline to approximate a spline. 

 

Parameters
Description
pCurve
[out] Pointer to newly created polyline entity.
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; OdResult::eNoDatabase if unable to access database or system variable.

Depending on the value of the PLINETYPE system variable and the spline itself, the resulting curve can be OdDbPolyline, OdDb2dPolyline or OdDb3dPolyline. OdDb3dPolyline will always have line segments. Otherwise, the resulting polyline has line segments when the PLINECONVERTMODE system variable is 0, and the arc segments, if PLINECONVERTMODE is 1. 

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.