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.

Lowest overhead ways to find loops of curves and faces?

joshtargojoshtargo Member Posts: 593 EDU

I'm working on my own lightening script for aluminum plate and want to query for the outermost faces (not the two planar faces, or any inner ones), as well as one of the two planar loop curves that define that series of faces.

QLoopEdges doesn't seem to work for this when the seed is one of the edge curves. And I don't think there's a similar query for a ribbon of faces (which unfortunately may not be all tangent to each other.

Currently using a bounding box and qclosestto to find any outer edge or face, then a while loop with qadjacent. And a bunch of qi resection and q subtraction to narrow it down and make the list unique. Works, but wondering if there's a more elegant way.

Can I somehow use a BoundedFaces query to subtract out anything contained by one of the two main planar faces?

Is there some other trick or low overhead method to quickly get the outer loop faces and edges as queries?

Answers

  • Caden_ArmstrongCaden_Armstrong Member Posts: 450 PRO

    https://www.smartbenchsoftware.com/post/a-few-more-undocumented-featurescript-functions

    Construct paths is probably useful here because it will group all the loops, assuming no branching.
    But you'll probably need to use size of the bounding box to filter out which is the perimeter vs the inner loop.

    I would start with one of the planar faces, find all the adjacent edges, make your loops, and then when you have the perimeter, you know the perimeter faces are adjacent to those edges but are not the planar face. Knowing your part is a plate lets you make some helpful assumptions (like all faces are either a planar face or an edge face).

    www.smartbenchsoftware.com --- Renaissance --- fs.place
    Experts in Onshape Automation - Custom Features and Integrated Applications
  • joshtargojoshtargo Member Posts: 593 EDU

    I'll try it, thanks!

  • wille_jwille_j Member Posts: 97 ✭✭✭

    qAdjecent is incredibly powerful and I sometimes forget about it. If you know your flat face to start with that might be a fast way. Same as Caden’s suggestion, you’d have to filter for what’s inner loops.
    I can’t say from just this which is fastest.

  • EvanReeseEvanReese Member, Mentor Posts: 2,979 PRO
    edited June 29

    I think this is what you're going for. The qAdjacent path could get you there, but I think you're barking up the right tree with qLoopBoundedFaces(). If you already know your big flat faces, and you can find one of the boundary faces (a face closest to a bBox corner is a good way, just subtract the big flat faces). Here's an example of it just using a query variable. https://cad.onshape.com/documents/000f167852a6107a59da26c1/w/078ce80e912e6977e1bea42e/e/67d9ade95d4ffb7b7a7243fd

    image.png
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.