Creating a TopoDS_Solid with voids

I'm trying to create a TopoDS_Solid (an extruded profile) with a handful of void openings cut from it.  According to several places in the online documentation, the first shell specified for a new solid is the outer shell.  Subsequent shells added to this solid are considered to be voids or hollows within that first shell.  I think I'm creating the solid the right way before exporting the file to STEP, but every STEP viewing program I can find imports all of these shells as solid shapes, not as a single solid with multiple voids.  What am I doing wrong?  Here's a simplified version of my code (the actual code is far too long & involved to post here).

BRepBuilderAPI_MakeSolid solidb(outer_shell);
for (all void openings)


shape_tool->SetShape(my_label, solidb.Solid());

Ben Hollingsworth's picture

I should point out that I've verified that the resulting solid does have multiple shells, according to this check:

    TopTools_IndexedMapOfShape map;
    TopExp::MapShapes(solidb.Solid(), TopAbs_SHELL, map);

    printf("solid contains %d shells\n", map.Extent());

For some reason, this isn't getting exported to STEP in a manner that shows them as voids.  I'm using STEPCAFControl_Writer to Transfer to STEP using the default mode, which is STEPControl_AsIs.  I tried specifying STEPControl_ManifoldSolidBrep, but with identical results.

Ben Hollingsworth's picture

By analyzing the resulting STEP files, it appears that OCCT is creating my STEP element as a BREP_WITH_VOIDS.  This seems reasonable, but doesn't work in any STEP reader I've encountered.  All of the working STEP models that I can find create both their outer shell and their void shells as multiple MANIFOLD_SOLID_BREP entities.  Is there a way that I can tell OCCT to create the latter?  As I mentioned earlier, passing STEPControl_ManifoldSolidBrep to STEPCAFControl_Writer.Transfer() still creates BREP_WITH_VOIDS.

Ben Hollingsworth's picture

Since nobody is apparently able to respond here in the forums, is this a question that could be answered through paid technical support?  We need to get this problem resolved, and we're willing to pay for help if necessary.

Forum supervisor's picture

Dear Ben,

For efficient resolving of your actual tasks you can consider using our support programs. Please don’t hesitate to communicate us via Contact Form to exchange information about our expertise and services and general context and specific needs of your projects.


Best Regards,

Forum supervisor