I want to find a mapping from the faces of two shapes S1, S2 to the faces of the shape S that has been created by a boolean operation of the shapes S1 and S2.
Several threads in this forum state that one can use the three methods IsDeleted, Modified and Generated of the class BrepBuilderAPI_MakeShape to solve this problem.
So I first tried to tried to realize the meaning of these methods by the following example:
First I construct two cylinders and fuse them:
BRepPrimAPI_MakeCylinder makeCylinder1(1.0, 5.0);
BRepPrimAPI_MakeCylinder makeCylinder2(0.5, 5.0);
TopoDS_Shape cyl1 = makeCylinder1.Shape();
TopoDS_Shape cyl2 = makeCylinder2.Shape();
gp_Vec vec(0.0, 0.0, 5.0);
gp_Trsf translation = gce_MakeTranslation(vec);
BRepBuilderAPI_Transform transform(cyl2, translation);
cyl2 = transform.Shape();
BRepAlgoAPI_Fuse op(cyl1, cyl2);
The unfused cylinders cyl1 and cyl2 look like this:
|--| - Face1
| | - Face0 Cyl2
|--| - Face2
|----| - Face1
| | - Face0 Cyl1
|----| - Face2
And the fused cylinder (op.Shape) looks like this:
So I would say that Face2 of Cyl2 has been deleted and Face1 of Cyl1 has been modified. Additionally some face should have been generated.
When I use the methods IsDeleted, Modified and Generated I get the follwing results:
IsDeleted: Only Face2 of Cyl2 has been deleted. This is like I expected.
Modified: Face1 of Cyl1 and Face0 of Cyl2 has been modfified.
Face1 of Cyl1 is correct but why has Face0 of Cyl2 been modified?
Generated: No faces have been generated.
These results look strange to me cause of the result of Modified and the missing generated faces. How shall I build my mapping function with just the above information?
So can someone explain the exact meaning of the three methods and how to use their results to build the mapping function?
Thanks in advance