Common faces saved in brep files

I'm looking at an example of two boxes side by side, the common face being shared between the two boxes (i.e. IsSame() returns true, which means that they are exactly the same memory object). However, when written into a brep file (the two are part of a Compound), that common face is written twice (instead of f having 11 faces, the brep file says there are 12). Is there any way to tell the brep writer to avoid writing this face twice? I'm asking because the brep file is imported into a mesher; this mesher (depending on the complexity of the face), might see the face output twice as two different faces, which breaks the meshing algorithm.

Just a clarification: to obtain the model, I'm creating the two boxes, identify the common faces in each box, and then use BRepTools_ReShape to replace a face from one into the other. Do I need to fix the result of BRepTools_ReShape using ShapeFix_.... to get that common face written only once (maybe there's some orientation issue involved)?


Tiberiu Chelcea's picture

It seems that (at least part of) the problem is that the edges in the face that's been replaced are not shared, and therefore the face is "different" somehow. When applying ReShape to a face, do I have to add to the reshaping object all the edges and their points? Do I have to apply ReShape three times (first for vertices, then for edges, and then for faces?