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.
efficiently groove down center of a face
adamohern
Member, OS Professional Posts: 216 PRO
Let's say I want to run a groove down a long rectangular face. I can easily achieve that by requiring the user to select three faces: the face for the groove, and the two adjacent (perpendicular) faces. With the perpendicular faces I can easily find a midplane and build my groove from there.
Is there a way to be smarter about it, not requiring the user to select three faces? Could I, for example, select only the groove face and then somehow reliably find a midplane without the perpendicular faces? What if the edges are rounded?
Is there a way to be smarter about it, not requiring the user to select three faces? Could I, for example, select only the groove face and then somehow reliably find a midplane without the perpendicular faces? What if the edges are rounded?
0
Comments
From there, you can make a coordinate system out of the edge and the face, take a bounding box of the face, and calculate any other positions you need based on that.
In the cases where that heuristic isn't correct, you can add a boolean to flip it 90º, and/or an option to provide another edge (really any ALLOWS_AXIS) as the primary axis, replacing the longest linear edge above.
For the specific case of ignoring one fillet, you could write logic around evEdgeConvexity or qTangentConnectedFaces to do the job... for instance, look among the planar faces which are edge-adjacent or tangent connected to the given face.
However, I wouldn't think it'd be very robust. Certainly, it wouldn't work if you replace the fillets with chamfers. Maybe we could make a query for faces which are perpendicular and adjacent-for-a-broader-definition-of-adjacent, but even then, there may be useful cases where those faces just aren't there, like if there's a draft involved.
Basically, it does come down to what you care about when defining the groove, and whatever those references are, I usually prefer having them passed in, and not relying on query magic to infer them. That way, the dialog provides good documentation about what the feature does... or at least, it will once we start putting labels in there properly!
I see a few options:
- Using the face center, as above
- Using the part center
- Using a specified distance from a face or edge
- Using the center of two faces, as you currently have
So maybe an enum which switches between some subset of these methods?Of course, I'm talking about trying to make a general-purpose feature that other people understand. If your goal is to improve your own workflows and you know the set of possible topologies well, the optimization you're talking about sounds useful.