TopoDS_CompSolid from 2 solids


I am trying to build a compsolid from 2 solids of 6 faces that share a face. The result should be a TopoDS_CompSolid consisting of 2 solids and 11 faces. I create each solid by sewing the faces together. How do I do to combine the solids in such a way that a compsolid is created?

Marco Matt's picture

I don't work with solid, but I suppose you can try with BRepAlgo_Fuse.

TopoDS_Solid s1 = ....;
TopoDS_Solid s2 = ....;
TopoDS_Shape cs;
BRepAlgo_Fuse result(s1, s2);
if ( result.IsDone )
cs = result.Shape();