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.

Options

How to select all faces on a given plane?

duncan_fordduncan_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.

Answers

  • Options
    mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    edited September 2016
    You could try a combination of qIntersectsPlane, qVertexAdjacent, and qParallelPlanes. 

    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
  • Options
    duncan_fordduncan_ford Member Posts: 4 ✭✭
    Thanks for the input. If I type "q", I don't see "qParallelPlanes" in the list?
  • Options
    mahirmahir Member, Developers Posts: 1,291 ✭✭✭✭✭
    It's in the help file, so I'm assuming it's a valid query. It might be one of the new functions added with the last round of improvements, so make sure you're importing the latest version of featurescript (408).
  • Options
    duncan_fordduncan_ford Member Posts: 4 ✭✭
    edited August 2016
    OK. I created this script only days ago, with version 392. Changing to 408 revealed qParallelPlanes. Finally able to select all the faces I want, and this was the query in the end:

    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.
Sign In or Register to comment.