How to find the arc length of part of a curve

I need to be able to find the arc length of an edge. More specifically, I would like to be able to obtain the arc length of a curve between two parametric locations on the curve.

I expect the functionality exists. I am just having trouble finding it.

ekiroglu's picture

Hello,

Let's assume that your parameters are U1 and U2, and your curve is Handle(Geom_Curve) Curve ;

Handle(Geom_Curve) NewCurve = new Geom_TrimmedCurve( Curve, U1, U2 );

TopoDS_Edge NewEdge = BRepBuilderAPI_MakeEdge( NewCurve );

GProp_GProps System;
BRepGProp::LinearProperties( NewEdge, System);
Standard_Real Length = System.Mass();

I hope that this may help.

Erki.

Rob Bachrach's picture

That looks like it will work. Thanks for the help.

Rob