Arc length reparameterization of a curve

Hi everyone,

I am currently confronted with the task of splitting a curve in two parts of equal arc length. Is there any native OpenCascade functionality that can help me in this? I just found the topic http://www.opencascade.org/org/forum/thread_4351/ which shows me how to get the actual length of a curve, but I can see no way of finding the point that splits my curve in two like I said.

Thank you in advance for your help!
Regards, Tom

Roman Lygin's picture

Hi Tom,

Consider use of GCPnts_AbscissaPoint, for example:

Adaptor3d_Curve AC = …;

GCPnts_AbscissaPoint anAP (AC, GCPnts_AbscissaPoint::Length(AC) / 2, AC.FirstParameter());
gp_Pnt aPnt = AC.Value (anAP.Parameter());

HTH.
Roman

Mauro Mariotti's picture

Hi Roman and all,

the title (not the body) of this topic is just what I need: given a Geom_Curve, creating a new one which is arc-length parameterized and approximates it with a given tolerance.

A solution would be to define an AdvApprox_EvaluatorFunction, which calls GCPnts_AbscissaPoint at every evaluation,
and pass it to AdvApprox_ApproxAFunction, but this would be extremely slow, I guess.

I wonder if there is something ready.

Regards.
Mauro

Mauro Mariotti's picture

Maybe I have found it:

Approx_CurvilinearParameter,
"approximation of a Curve to make its parameter be its curvilinear abscissa"

jelle's picture

Iterating over the GCPnts_AbscissaPoint results would give you the parameters at the given curve length, just use those to make a number of Geom_TrimmedCurve's?