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.

Querying for the [other] part given two faces that touch each other? (with one face from each part)

Emily_Qi_WangEmily_Qi_Wang Member Posts: 13 EDU
edited February 2016 in FeatureScript
See situation below. The blue part and green part each have one face that touches the other. In my current Feature dialog, the user is prompted to choose the relatively small/skinny face of the blue part that happens to intersect the green part. I do not want to have to prompt the user to select the green part in the Feature dialog because typically the green part is hidden while this Feature is being used. 

I would like to eventually do some boolean operations involving the green part. Without making extra assumptions about the corners or edges (this is a very simple case and not necessarily representative of how the edges/corners will look in other scenarios), can I query for the green part somehow given just the small blue face? 

I combed through FsDoc and did not find a satisfying solution to this. I have attempted some strategies with qEdgeAdjacent, qTangentConnectedFaces, qFaceOrEdgeBoundedFaces, qIntersectsPlane, and qContainsPoint; all to varying levels of success and making additional assumptions. This seems like a simple query but I have not found a simple solution. I'm happy to supply more sample code for the queries above to explain them in more detail. 

EDIT: Another idea that recently came to mind is querying for all the faces and finding which face is 0 meters away (maybe using evDistance?) from the known small blue face. However it seems like overkill to do a qEverything for all the faces, especially if there are many parts in the Part Studio. 

Any suggestions on what to try next would be greatly appreciated. Thanks in advance!





Best Answer

Answers

  • Emily_Qi_WangEmily_Qi_Wang Member Posts: 13 EDU
    edited February 2016
    Thanks for the many suggestions, Kevin! We decided to not query, and followed the strategy used in extrude.fs. In summary, this involves querying for all the parts in the part studio with a qEverything, removing the tools and anything that's not a solid body from the qEverything result, and then doing a boolean operation. 
Sign In or Register to comment.