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.
How to select all faces on a given plane?
duncan_ford
Member Posts: 4 ✭✭
I'm sure this must be easy, but I just can't seem to see how to do it.
My first attempt was this:
qIntersectsPlane(qCreatedBy(id + "combBaseExtrude", EntityType.FACE), plane(vector(0, 0, 0), vector(0, 0, 1)))
After using debug to see what this highlighted, I realized the fault was mine and that intersects is precisely that and not "lying on". OK.
Next I tried this:
qIntersection([qCreatedBy(id + "combBaseExtrude", EntityType.FACE),qCreatedBy(makeId("Right"), EntityType.FACE)])
This really feels like it should work to me, but again I think I appreciate why it doesn't. I think the fact that the two queries generate distinct sets means that there's no entity in both sets.
I think I'm just thinking about the problem the wrong way, so I'd be delighted if someone could enlighten me as to how to select all faces that are lying on a given plane.
My first attempt was this:
qIntersectsPlane(qCreatedBy(id + "combBaseExtrude", EntityType.FACE), plane(vector(0, 0, 0), vector(0, 0, 1)))
After using debug to see what this highlighted, I realized the fault was mine and that intersects is precisely that and not "lying on". OK.
Next I tried this:
qIntersection([qCreatedBy(id + "combBaseExtrude", EntityType.FACE),qCreatedBy(makeId("Right"), EntityType.FACE)])
This really feels like it should work to me, but again I think I appreciate why it doesn't. I think the fact that the two queries generate distinct sets means that there's no entity in both sets.
I think I'm just thinking about the problem the wrong way, so I'd be delighted if someone could enlighten me as to how to select all faces that are lying on a given plane.
0
Answers
qIntersectsPlane gets you all the vertices that intersect the plane in question.
qVertexAdjacent finds all the faces that are attached to those vertices.
qParallelPlanes filters out all the faces are not parallel to your plane.
What you're left with is all the faces that are parallel to your plane and have a point lying on that plane, making those faces coincident to the plane.
I feel like there is probably an easier method, but in the meantime this will probably work
qParallelPlanes(
qIntersectsLine(
qCreatedBy(id + "combBaseExtrude", EntityType.FACE),
line(vector(0, 0, 0),vector(0, 1, 0))
),
plane(vector(0, 0, 0), vector(1, 0, 0))
)
Thanks for the assistance.