Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

How to find partial length of edge

konstantin_shiriazdanovkonstantin_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

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    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.

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited August 2017
    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 :#
Sign In or Register to comment.