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.
Boolean feature that trims excess material
In Catia the feature is called "Union Trim", which functions like a boolean add, but allows the user to specify which areas to not include in the boolean operation.
For example, a tube with some internal features, and you want to keep the inside of the tube but combine it with another part:
Currently in order to achieve this result, my workflow is as follows:
- Intersect Body 1 and Body 2 (and keep tools)
- Boolean subtract the intersect body from Body 2
- Use the correct bodies that are outputted by the boolean subtract and boolean add it to Body 1
Is there a feature on onshape that does this? It's hard to use a boolean-based workflow without this feature.
Best Answer
-
Caden_Armstrong Member Posts: 236 PRO
Like this?
https://cad.onshape.com/documents/637f7dcd183f8d1f8996db01/w/55e761be01ee214a0cee4318/e/5d6f6e405a59707a0edf07e6
www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications1
Answers
Like this?
https://cad.onshape.com/documents/637f7dcd183f8d1f8996db01/w/55e761be01ee214a0cee4318/e/5d6f6e405a59707a0edf07e6
Custom FeatureScript and Onshape Integrated Applications
Wow thank you so much! This is exactly what I needed :)
Hi Caden, this tool you created works pretty amazing when the one body intersects the other body a single time. However, it will error if there is more than 1 intersect. How difficult would it be to change it? Instead of "Keep Front" and "Keep Back", you would have a selection tool that will select "faces to remove"
This is what will currently give an error:
Ideally, the user can select the faces they want to be removed:
If you are able to create this feature, it would be so amazing
@sichun_xu it's not possible to "select faces" because the faces do not exist until the feature is created. I'm guessing CATIA is combining two features into one dialog. Instead of using Intersect, subtract one from the other (with Keep tools) then Union together. Yes, there are two redundant parts left over but I don't think it's too much of an inconvenience.
This may not be the info you'r looking for because you're interested in a dedicated feature.
in solidworks I guess there's a similar function in their enclose option. it allows selection of bodies in the temporarily split parts when the feature dialogue is open. in Onshape this is not possible.
I guess it would only work if points (or mate connectors) were available for a qContainsPoints, that would aid in the selection of the bodies.
FYI.
another way that does cover your 2nd use case is to make an offset face select all 'pocket faces', set to 0 mm.
then split part with that new surface, then unite.
But that may not be what you're looking for…
Neil is definitely correct in that selections can't be made while a Feature is in progress. But there are some options to make it a bit more interactive.
I added to my feature the option to "select to remove" and select to keep. You select geometry on the tool body that is in the areas you want to keep or remove. The problem is that you end up with overlap. So if geometry spans the split, it will delete or keep both bodies, so it might take some finagling. But that does bring up the point, why not just use multiple features, does it all really need to be done in one step? Sometimes a compromise has to be made, because otherwise you end up with some unnecessary complexity.
https://cad.onshape.com/documents/637f7dcd183f8d1f8996db01/w/55e761be01ee214a0cee4318/e/5d6f6e405a59707a0edf07e6
Custom FeatureScript and Onshape Integrated Applications
Thanks @NeilCooke and @Caden_Armstrong for explaining this to me and helping me out, you guys are incredible. Both of you somewhat suggested that I might be trying to do too much in one feature. Maybe I'm approaching this problem incorrectly so let me show the geometry I am working on, it's a model of a cylinder head that I am currently modelling (picture is cross section):
https://cad.onshape.com/documents/8930d09cea18509102a58ef9/w/0ed16bdc697984b61145d25b/e/866fdd7f806925a5f00cc85e
I modeled this in a number of part that I will join and trim at the end to form a singular part. I've been trying to simplify the topology on this thread, but I don't think I've captured the intent well. I think below is what I am actually trying to do and failing to find a simple workflow for:
Part (https://cad.onshape.com/documents/7a62577ef577a4bcf3e68e5e/w/68c67706492eeb1a60892313/e/4ba455e5696116441568d056):
Goal :
The fastest way I can do this operation is with 5 features! (4 booleans + 1 delete part) I'm new to onshape so maybe I'm approaching this wrong, but this seems excessive to do what I think is a relatively simple operation that other CAD programs can do in 1 feature. Is there a better way to do this? I do think 5 features is somewhat of an inconvenience even if it's possible.
Here is what I did: https://cad.onshape.com/documents/7a62577ef577a4bcf3e68e5e/w/68c67706492eeb1a60892313/e/179967c3e4c4642d89aeb349
There are many ways that this particular problem could be solved in fewer features. I would most likely go back and redo the way that the initial extrudes for part 2 were done, but assuming that the parts just exist (either imported, or derived or just too much history to muck about with) there's a pretty simple solution with boolean union and delete face/heal.
https://cad.onshape.com/documents/8a730fc58dd5a8de84d58ddc/w/d4c15f1553eecf0a4d24418a/e/5df83b664fae7b6b37565cf0
@Caden_Armstrong: I was working on a similar extension of your code, based on vertices. (and mate connectors, the latter being very flexible, there's a midplane one, but you can also move it implicitly).
this prevents overlaps. I wasn't fully happy yet so hadn't published it yet, but here you go. feel free to use/adapt. (like I did with yours)
https://cad.onshape.com/documents/303afc92fcce5c7160b6e423/w/87c6f3bb1c89d0c5150683fc/e/bac457eadd65a703c9adabaa?renderMode=0&uiState=67d4609c380151127ffc0a60
one major UI hickup is that I'm using an array-by-selection in the feature definition, but I wasn't able (yet) to get the MC-selection button for the array. so first you have to select a vertex, to expand the array, go to that vertex, and replace it with an MC.
I'm not sure with this functionality 'union trim' is still the right word. It's starting to look a little bit like Solidworks's intersect tool although that also splits with surfaces…
The more I think about this, the more I'd like to see the Split command have some added functionality:
If this was possible, I might use a part/part bi-directional split, and then union the parts I wanted to keep, and delete the ones that I no longer needed.
Hi @S1mon ,
Yeah, I think for most use cases delete face works, but it's an inherently destructive workflow and won't work for a slightly altered geometry. This is the case that I covered at the start of this forum post. If you have features that are "absorbed" by the first Boolean feature, delete face can't ever get them back, even if it's a simple feature. I think my 5 step boolean workflow is the only thing that I can think of to achieve it.
Link to new base part: Union Trim workaround | Absorbed Part
Link to my 5 step boolean still working: Union Trim workaround | Absorbed Workflow