length of Geom_Curve

how i can determinate the length of Geom_Curve?
and i'have a Curve in 2d space how to convert this curve in 3d space with a tolerance (of convert).

thank you for your help

Hugues Delorme's picture

To get the length of a curve you can try this :

Geom_Curve curve = ...
// Total length :
Standard_Real totalLength = GCPnts_AbscissaPoint::Length(GeomAdaptor_Curve(curve));
// Portion length between two parameters :
Standard_Real portionLength = GCPnts_AbscissaPoint::Length(GeomAdaptor_Curve(curve), startU, endU);