Joining two solids with coincide face

Hi,

I have the following problem: I want to join two TopoDS_Shapes that have a coincide face. For example two cubes with the same side length 1, one of them located in (0,0,0), the other in (0,0,1). What I want is a TopoDS_Shape consisting of 7 faces (the six outer faces of the composed object and the coincide face).

I tried it with BRepAlgoAPI_Fuse which returned a shape with 10 faces, with BRepFeat_Gluer I got 6 faces and with BRepAlgo_Sewing and TopoDS_Compound 12 faces (the coincide face exists two times in the new object).

Does anyone know how to join shapes in a way that coincide faces exist exactly one time in the joined object?
I know that similar questions have already been asked in this forum, but I couldn't find a sufficient answer.

Thanks in advance

Angelika

Rob Bachrach's picture

I could be wrong, but I don't believe any of the existing CASCADE
algorithms will give what you are looking for. You could try using
the Gluer and creating a compound containing that and the results
of a Common operation. I think you will find that the results of
the Sewing operation have the face twice, but with opposite
orientations.

Good luck!

leibscher's picture

Thanks a lot for your help.
I had no success with the Common operation but it worked fine with the Section operator.
The only problem is that the resulting shape can not be converted into a solid. (Maybe, because it is invalid due to the internal face).
But for my purposes a shell is sufficient.

Best regards

Angelika

Lee Sangsu's picture

Dear Angelika,

As far as I know, there is no algorithm to produce such a result and probably there will not be in OpenCascade, for such an object has invalid topology. According to your description, the coinside face will not have any connection with the outter faces, and it is topologically isolated from the other faces, and it should have the orientation TopAbs_INTERNAL. In fact, this case can exist, but normally OCC algorithms will not make such an object, and will not properly deal with it.

I hope this will help you.
best regards,
Sangsu Lee