DiscussionsIssue archiveOther usage issues

Archived discussion

Get Point on Curve/Wire by Length

Other usage issuesTue, 06/30/2009 - 17:498 replies

Browse this forum
QuestionAuthor

... as the subject says I want to get a point on a wire by length - tried everything but I see no way to do so. Using the parametric values also doesn´t help... someone an idea???
Thanks - Stefan

Discussion

8 archived replies

Posts are displayed in their archived order.

01Commenter-1

BRepAdaptor_CompCurve is the solution.See code below :

BRepAdaptor_CompCurve aCompoundCurve(TopoDS::Wire(aRailSh), Standard_True);
"then"
aCompoundCurve.D0( parm, aPnt );

should give the point in space.

Commenter-1

02Commenter-2

I had problems with doing it like that
I had to do my own "BRepAdaptor_CompCurve" and using recursive code to have a correct result, as using the code as you mentionned was producing a point at a bad distance (accuracy issue).

Commenter-2

03Author

Ahhhh.... and I thought it´s something "easy".

04Commenter-2

well, it's supposed to be easy..
the "easy" way is to use GCPnts_AbscissaPoint
but as i said, it gave me incorrect results. you can still test with your wires/curves to see if it works for you.

Commenter-2

05Author

Hmmm... yeah the problem is that I have to use the length to find the point... (it´s some kind of strange transformation and it will only work correct when I take the length). Finding a point by length doesn´t seems to be supported. And an recursive alg. could be very time consuming.
damn....

06Commenter-2

> And an recursive alg. could be very time consuming.
no it's quite fast (at least fast enough for my cases)

Stéphane

07Author

yeah... u say the algorithm is quite good. Can I see it. ;)

08Author

Ok.... it took me some time to check out what the second parameter means... thanks i will give it a try!!!