Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
constructPath() sometimes doesn't return a continuous path, possible bug?
jeff_brown304
Member Posts: 23 ✭✭
I have been using constructPath() to construct a continuous path along a set of connected edges supplied by the user. My code then iterates over each edge in the path and queries the geometry using evApproximateBSplineCurve(). If the path's flipped flag is set to true for an edge, then I process that edge in reverse.
For the most part, this has been working well. However, I have found a case where constructPath() returns a Path that is not continuous. When I make a path containing a straight edge and the arc of fillet tangent to that edge, the arc is oriented backwards in the path and its start point does not coincide with the end point of the preceding straight edge (even when taking the flipped flags into account).
I'm not sure what to do about this issue. I could perhaps work around the problem by testing which end of the arc is closest to the previous segment and flipping it accordingly. However, before I do that, I wanted to check whether this is expected behavior and whether I've misinterpreted something important along the way.
I've made a simple test case to reproduce the problem I have observed. See here: https://cad.onshape.com/documents/13098a696e749533a2f26c06/w/54a890016acd015349686206/e/cedce1fd52f345baf00372e6
For the most part, this has been working well. However, I have found a case where constructPath() returns a Path that is not continuous. When I make a path containing a straight edge and the arc of fillet tangent to that edge, the arc is oriented backwards in the path and its start point does not coincide with the end point of the preceding straight edge (even when taking the flipped flags into account).
I'm not sure what to do about this issue. I could perhaps work around the problem by testing which end of the arc is closest to the previous segment and flipping it accordingly. However, before I do that, I wanted to check whether this is expected behavior and whether I've misinterpreted something important along the way.
I've made a simple test case to reproduce the problem I have observed. See here: https://cad.onshape.com/documents/13098a696e749533a2f26c06/w/54a890016acd015349686206/e/cedce1fd52f345baf00372e6
Tagged:
0
Comments
Incidentally, it would save me a lot of math if there was a function similar to evCurveDefinition() that returned more information. Specifically if the curve is a line, I'd like to know its length without having to call evLength() to get it. Also, if the curve is an arc segment (not a full circle), I'd like to know its start, end, and mid point (or something equivalent). Right now I'm recovering this geometry from the BSpline representation in order to generate a polyline with line and arc segments.
Thanks!
So for now I’m working with the spline representation because that’s the best I can get.