Building a TopoDS_Shape from multiple TopoDS_Solid objects

So fundamental that it's a bit embarrassing. How might I build a single TopoDS_Shape object from multiple TopoDS_Solid objects?

Dmitrii Pasukhin's picture

Hello,

There are 2 options:

TopoDS_Compound aComp;
BRep_Builder{}.MakeCompound(aComp);
BRep_Builder{}.Add(aComp, aSolid1);
...
BRep_Builder{}.Add(aComp, aSolidN);

And second option is Boolean Fuse operation.

BRepAlgoAPI_Fuse fuse(face1, face2);
fuse.SimplifyResult();
return fuse.Shape();

Best regards. Dmitrii.