BRepAlgoAPI_Common unexpected behavior

Hello,

I have two quite simple shapes that was built by a series of previously applied boolean operations (see attached .brep files). They obviously have a common solid part, but when I try to build their common part via BRepAlgoAPI_Common I receive an empty shape as a result:

Draw[40]> restore wall.brep
wall
Draw[41]> restore charger.brep
charger
Draw[42]> bopcheck wall
This shape seems to be OK.

Draw[43]> bopcheck charger
This shape seems to be OK.

Draw[44]> bop wall charger
Draw[45]> bopcommon common
Draw[46]> bopcheck common
This shape seems to be OK.

Draw[47]> nbshapes common
Number of shapes in common
VERTEX : 0
EDGE : 0
WIRE : 0
FACE : 0
SHELL : 0
SOLID : 0
COMPSOLID : 0
COMPOUND : 1
SHAPE : 1

Is there any explanation for this behavior? Please share your ideas.

Petr

Attachments: 
Petr Matousek's picture

wall.brep attached

Attachments: 
Petr Matousek's picture

charger.brep attached

Attachments: 
Petr Matousek's picture

By further investigation I got errorneous results for fuse and cut operations on the same input shapes:

Draw[3]> restore wall.brep
wall
Draw[4]> restore charger.brep
charger
Draw[7]> bop wall charger

Draw[11]> bopcut cut
Draw[12]> bopcheck cut
V/V: x6 x7
V/V: x14 x15
E/E: x26 x72
E/F: x9 x26
E/F: x9 x72
V/Z: x33 x52
V/Z: x50 x52
E/Z: x32 x52
E/Z: x34 x52
E/Z: x49 x52
E/Z: x51 x52

Draw[13]> bopfuse fuse
Draw[14]> bopcheck fuse
V/V: x6 x7
V/V: x14 x15
E/E: x31 x70
E/F: x9 x31
E/F: x9 x70

Are the input shapes incorrect even the bopcheck verifies them as valid?

Forum supervisor's picture

Dear Petr,
The problem is that the arguments are misaligned on the value 2.02305e-007.
The following draw script proves that:
restore wall.brep b1
restore charger.brep b2
explode b2 so; copy b2_4 b2
don b1 b2; fit
explode b1 v; explode b2 v
distmini d b1_3 b2_4
# the distance value is : 2.02305e-007
See the attached picture.
So, in this case we can suggest you to use 'fuzzy' option available in current development version(with value 2.5e-7) or to increase the tolerance values of the shapes.
If you need our support, you may contact us via the Contact Form http://www.opencascade.org/about/contacts/.

Best regards
FSR

Attachments: 
Petr Matousek's picture

Dear FSR,

thank you for your analysis and explanation. But I still do not understand why the boolean common is empty. Even the two vertices are misaligned by the small distance there is still common solid part of a "normal" size comparable to the size of the two overlaping solid shapes. Can you (or anyone else) please explain this?

Petr