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.

qFarthestAlong producing unexpected results

Aaron_HooverAaron_Hoover Member Posts: 35 EDU
edited November 2018 in FeatureScript
I have two rectangular bodies intersecting at a right angle, and I've extracted the edges of one of the two large (cap) faces resulting from the intersection. For each of the bodies, I'd like to get the farthest edge that's perpendicular to the long axis of the body. 

I had assumed that passing a direction vector parallel to the long axis of the body (and pointing toward the intersection) to qFarthestAlong would give me that edge. However, the result I get is actually the three edges that are not closest to the center of body. I've tried to capture my results in the image below. 



The vector at the origin of the world coordinate system is the direction vector which is parallel to the long axis of the blue body. Also, if I configure the bodies to meet at an angle greater than 90 degrees, the vector parallel to the long axis of the blue body on the left is not returned by the query, but the one of the right still is. I should also add that calling evDistance between the coordinate system attached to the body and the edges returned by qFarthestAlong gives a larger distance for the edge I want and smaller distances for the other two edges returned. 

What am I misunderstanding about the output of qFarthestAlong?

https://cad.onshape.com/documents/23dc8ff499026deeed6aa19e/w/0031df2b6d633ae1a21ed033/e/017e4642543f95576afa411c
Tagged:

Best Answer

Answers

  • MBartlett21MBartlett21 Member Posts: 1,624 EDU
    @Aaron_Hoover
    That is working exactly as it is meant to.
    Those edges have an endpoint that is farthest in your direction.
    You would then want to filter the lines based on their direction.
    MB - I make FeatureScripts: view FS (My FS's have "Official" beside them)
  • Aaron_HooverAaron_Hoover Member Posts: 35 EDU
    Thanks, @kevin_o_toole_1! That definitely clarifies the situation. I had assumed that qFarthestAlong() would use the origin of a line representing an edge, but it makes sense that it resolves to the farthest entity. 

    I've actually taken a completely different approach to solving the underlying problem (using a Boolean intersection) that doesn't require me to know the exact shape of the intersection. I think it will wind up being far more robust.  
Sign In or Register to comment.