Fri, 09/09/2005 - 13:56
Forums:
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
Fri, 09/09/2005 - 15:35
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.
Tue, 09/13/2005 - 16:03
Thanks alot Rob!
The second approach is exactly what I needed!
Gerhard
Fri, 06/09/2023 - 18:07
I keep getting this page from google :)
GCPnts_AbscissaPoint::Length
Is a great choice when working with geom_curves.