DiscussionsIssue archiveOther usage issues

Archived discussion

Length of Geom2d_Curve

Other usage issuesFri, 09/09/2005 - 13:563 replies

Browse this forum
QuestionAuthor

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
Author

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

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.

02Author

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

03Commenter-2

I keep getting this page from google :)

GCPnts_AbscissaPoint::Length

Is a great choice when working with geom_curves.