How to find partial length of edge
konstantin_shiriazdanov
Member Posts: 1,221 ✭✭✭✭✭
I obtain a distance from point to some edge using evDistance, and then i need to evaluate a length of arc of this edge between the starting point of edge and the point defined by parameter from DistanceResult, but sadly DistanceResult doesnt use arc length parametrization, so the task is somehow to convert parameter value to the arc length parametrized format
0
Comments
-
Hmm, yeah. Unfortunately I also can't think of a non-numerical FS solution. Seems to me like the best fix would be for us to add an arcLengthParameterization argument to evDistance. Do you agree?
When evDistance was first released there were tolerance issues with our implementation of arcLengthParameterization that would have made inverting it on our end a poor idea. However those issues have since been fixed so we should have the right tools to support that option now.
In the meantime, a parameter search with evEdgeTangentLine seems like your best option. A binary (or 10-ary) search is the most obvious starting strategy, but once you're in a range that's somewhat linear (i.e. euclidian distance between two points is within some factor of edge length between those points), you can iterate to a new point by moving forward the euclidian distance along the edge and evaluating at that point. Since sane edges become more and more linear at smaller scales, that should converge very quickly.
1 -
thanks for quick answer, @kevin_o_toole_1. supporting that implementation on your side would be the best outcome. the problem with binary search may be in it's perfomance because in my case it should be used in double-nested loop
1

