-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request - Brep export with imprinted and merged surfaces #449
Comments
Just to be sure, does the following code do what you need in terms of merging? import OCP
import cadquery as cq
res1 = cq.Workplane().box(1,1,1).val().wrapped
res2 = cq.Workplane().box(2,2,2).val().wrapped
bldr = OCP.BOPAlgo.BOPAlgo_Splitter()
bldr.AddArgument(res1)
bldr.AddArgument(res2)
bldr.SetNonDestructive(True)
bldr.Perform()
im = bldr.Images()
merged = cq.Compound(bldr.Shape())
show_object(merged) |
@shimwell any updates, does the code merge the faces correctly? |
Ah sorry Adam, I only just noticed this suggestion. Thanks very much. We just have to get the Brep based faceting workflow working to test it in the neutronics simulations (https://github.com/makeclean/occ_faceter), will report back as soon as possible. |
NB: this functionality might be also relevant for HLR and SVG export. |
Taking another look at this Brep export and I notice that exporting a cq.Shape has toOCC and allows brep file export. But wondering how to export a cq.Compound as a Brep file |
Not sure that I follow - |
Have you seen that it's already implemented : |
Ah super that allows me to use |
@shimwell |
Thanks and sorry for getting mixed up there. I'm now able to export all (workplanes, cq.Shape, cq.Compound) to a Brep file. The Brep file currently just has the one volume so they all appear to be combined so I shall keep tinkering to see if I can get them to be separate volumes in the Brep. I shall try exporting assemblies next. Thanks for the help |
@shimwell if you're viewing the BREP afterwards with FreeCAD you will see that it is one volume, but underlying in the BREP file it remains seperate, its just the FreeCAD can't interpret it properly. |
Thanks @makeclean I would never have guessed that FreecCAD views all volumes as one. I do like FreeCAD, you know me too well. I've added the merge option as described at the top of this issue and noticed that the filesize of the merged brep is slightly smaller as expected. |
I think its that FreeCAD hasn't been told how to interpret it, in fact there is a bit of a lack of dedicated BREP viewers in general. |
I've been exporting a variety of geometries to Brep files, some multiple volume with Boolean operations. I noticed that sometimes the order of the volumes being input differs to the volumes in the file when reading the Brep back in with gmsh. Just wondering if there a way to read in Brep files with Cadquery, it would be helpful for figuring out which volume is which. I noticed in the docs that CQ an currently read in STP files and STL files. |
Try this: cadquery/cadquery/occ_impl/shapes.py Line 472 in 6b01d78
|
I've been testing out the merged surface Brep in a neutronics workflow and it looks like it is working so thanks for adding this feature. Demo video of Brep to neutronics prototype |
Perhaps quite low down on the list of nice features but it would be great if the BREP support allowed an optional removal of duplicate surfaces and use of virtual surfaces (also called imprinting and merging)
The text was updated successfully, but these errors were encountered: