I am using to compare shapes as they come from different sources and IsEqual cannot be used.
For some faces common returns empty compound. Here is a code to reproduce, as well as the brep file of the shape:
As a result, no warnings or errors are dumped to cout, shape is not null, and the compared.brep is an empty compound.
So, what is causing the problem? Is this a bug in algorithm? Or is the shape wrong? What could be the workaround?
Thank you!
Discussion
6 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hi,
I cannot reproduce the problem for me, the result is not empty. Here is the snapshot of a session in DRAW:
Draw[21]> restore faulty_face.brep a
a
Draw[22]> restore faulty_face.brep b
b
Draw[23]> bcommon r a b
Draw[24]> nbshapes a
Number of shapes in a
VERTEX : 146
EDGE : 147
WIRE : 1
FACE : 1
SHELL : 0
SOLID : 0
COMPSOLID : 0
COMPOUND : 0
SHAPE : 295
Draw[25]> nbshapes b
Number of shapes in b
VERTEX : 146
EDGE : 147
WIRE : 1
FACE : 1
SHELL : 0
SOLID : 0
COMPSOLID : 0
COMPOUND : 0
SHAPE : 295
Draw[26]> nbshapes r
Number of shapes in r
VERTEX : 146
EDGE : 147
WIRE : 1
FACE : 1
SHELL : 0
SOLID : 0
COMPSOLID : 0
COMPOUND : 1
SHAPE : 296
02Author
Apparently, I mixed up some results. Now two files are attached, which seem to be identical visually, but even test harness returns wrong results for common operation.
Archived image: external image
03Commenter-1
Everything works with the new shapes, too. You should use the actual BO, which are run by the command 'bcommon', rather than 'common', in Draw. The command 'common' runs obsolete version of BO.
04Author
I apologize for uploading non-reproducible problems!
Now I double-checked everything, installed the latest binary (7.5.0), and still got problems with simple geometry (attached).
Used 'bcommon', but the result of boolean is still empty shape. I hope this time it is reproducible!
Thank you for your time!
05Commenter-1
Now the problem is reproducible with conical_ring.brep. You are appreciated to register a bug in the bug tracker.
06Commenter-2
As for me it happens for any case where shapes do not have common geometry (at least 7.4).
TopoDS_Shape box1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 10, 10, 10);
TopoDS_Shape box2 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 20), 10, 10, 10);
Here common operation returns non-null compound.
I would advise to check the result by enumerating any vertex:
TopExp_Explorer ex(resShape, TopAbs_VERTEX);
if (!ex.More())
{
return false;
}