Exception when trying to fuse two through-sections

Hello.

I get an exception when trying to fuse two through-sections as shown in the examplecode below. Can anyone see a reason why this does not work? Does anyone know how robust the boolean operation are, (i.e. cut and fuse)?

double bottomPoints1[12] = { 20, -10, 0, 7100, -10, 0, 7100, -1190, 0, 20, -1190, 0};

double topPoints1[12] = { 10, 0, 10, 7100, 0, 10, 7100, -1200, 10, 10, -1200, 10};

double bottomPoints2[12] = { 10, 0, 10, 7100, 0, 10, 7100, -1200, 10, 10, -1200, 10};

double topPoints2[12] = { 10, 0, 25, 7100, 0, 25, 7100, -1200, 25, 10, -1200, 25};

BRepBuilderAPI_MakePolygon bottomPolygon1, topPolygon1, bottomPolygon2, topPolygon2;

gp_Pnt tmpPnt;

for (int i=0;i

{

tmpPnt.SetCoord(bottomPoints1[3*i], bottomPoints1[3*i+1], bottomPoints1[3*i+2]);

bottomPolygon1.Add(tmpPnt);

tmpPnt.SetCoord(topPoints1[3*i], topPoints1[3*i+1], topPoints1[3*i+2]);

topPolygon1.Add(tmpPnt);

tmpPnt.SetCoord(bottomPoints2[3*i], bottomPoints2[3*i+1], bottomPoints2[3*i+2]);

bottomPolygon2.Add(tmpPnt);

tmpPnt.SetCoord(topPoints2[3*i], topPoints2[3*i+1], topPoints2[3*i+2]);

topPolygon2.Add(tmpPnt);

}

bottomPolygon1.Close();

topPolygon1.Close();

bottomPolygon2.Close();

topPolygon2.Close();

BRepOffsetAPI_ThruSections loft1(Standard_True, Standard_True);

loft1.AddWire(bottomPolygon1.Wire());

loft1.AddWire(topPolygon1.Wire());

loft1.Build();

BRepOffsetAPI_ThruSections loft2(Standard_True, Standard_True);

loft2.AddWire(bottomPolygon2.Wire());

loft2.AddWire(topPolygon2.Wire());

loft2.Build();

BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());

Volker's picture

This question is quiet old, but:
I have similar problems with exceptions using BRepAlgoAPI_Cut.

I start with a solid and subtracts several solids created with BRepOffsetAPI_ThruSections. At some stage BRepAlgoAPI_Cut throws an exception. Has anyone found a solution or bypass to the menioned problem of BRepAlgoAPI-operations for general solids (ThruSections)?