An Error of Opencascade 5

I've constructed a complicated TopoDS_Solid
with 6 Shells. All of these Shells are Geom_BsplineSurfaces.

Now I want to fuse this Solid with a simple
TopoDS_Shape(For Example: A Box) using BRepAlgo_Fuse or BRepAlgoAPI_Fuse, but the results of the
Calculation of Opencascade are very funny and
unstable.

Has Anybody also found this Problem?

Stephane Routelous's picture

did you check that the generated solid is valid before doing the fuse ?

mayan_28373's picture

Yes, I've checked, all are right, even Display is right.

mayan_28373's picture

The Problem is BRepAlgoAPI_Fuse or BRepAlgo_Fuse,
They don't work correctlly, or don't work with various Shape.

Stephane Routelous's picture

if your input shape is not 100% valid, the algorithms may failed.
did you try to fix your solid also ?

mayan_28373's picture

How can I fix my Solid?
My Code is following:
Here shell, shell1, ..., shell5 are TopoDS_Shell and correct before using,
pp2, pp8 are cornors of this Solid,
.......
BRepBuilderAPI_MakeSolid solid(shell, shell1, shell2);
solid.Add(shell3);
solid.Add(shell4);
solid.Add(shell5);
TopoDS_Shape s10;
if(solid.IsDone())
s10 = solid.Shape();
myAISContext->Display(new AIS_Shape(s10));

TopoDS_Shape s11 = BRepPrimAPI_MakeBox(pp2, pp8);
BRepAlgoAPI_Fuse c10(s11, s10);
if(c10.IsDone())
s11 = c10.Shape();

myAISContext->Display(new AIS_Shape(s11));

Stephane Routelous's picture

for fixing, try :
ShapeFix_Shape FixShape;
FixShape.Init(solid);
FixShape.Perform();
TopoDS_Shape fixedShape = FixShape.Shape();

HTH,

Stephane

Stephane Routelous's picture

oops, sorry, replace solid with s10 in the code

mayan_28373's picture

Thanks

mayan_28373's picture

This line has always Problem during Runtime.
........
TopoDS_Shape s11 = BRepPrimAPI_MakeBox(pp2, pp8);
........

mayan_28373's picture

Sorry! False! This Line:
......
BRepAlgoAPI_Fuse c10(s11, s10);

mayan_28373's picture

The Problem is BRepAlgoAPI_Fuse or BRepAlgo_Fuse,
They don't work correctlly, or don't work with various Shapes.