Length of Geom2d_Curve

Hello,
I need the (approximated) length of a 2d curve. This is of course simple for lines and circular arcs, but quite difficult for general curves (arcs of ellipses, BSplines etc.). Does anybody know in which package I should look for an appropriate algorithm (I didn't find anything in Geom2dAPI).
Thanks alot
Gerhard

Rob Bachrach's picture

There may be a better way, but 2 possibilities come to mind:
1 - look at GCPnts_QuasiUniformDeflection to get a list of points on the curve. You can then add the lengths of the line segments between the points.

2 - turn the curve into a TopoDS_Edge and use BRepGProp::LinearProperties. The resulting mass is the curve length.

Gerhard Hofmann's picture

Thanks alot Rob!
The second approach is exactly what I needed!
Gerhard

Dario Pellegrini's picture

I keep getting this page from google :)

GCPnts_AbscissaPoint::Length

Is a great choice when working with geom_curves.