did you check that the generated solid is valid before doing the fuse ?
Archived discussion
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?
Discussion
11 archived replies
Posts are displayed in their archived order.
Yes, I've checked, all are right, even Display is right.
The Problem is BRepAlgoAPI_Fuse or BRepAlgo_Fuse,
They don't work correctlly, or don't work with various Shape.
if your input shape is not 100% valid, the algorithms may failed.
did you try to fix your solid also ?
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));
for fixing, try :
ShapeFix_Shape FixShape;
FixShape.Init(solid);
FixShape.Perform();
TopoDS_Shape fixedShape = FixShape.Shape();
HTH,
Commenter-1
oops, sorry, replace solid with s10 in the code
Thanks
This line has always Problem during Runtime.
........
TopoDS_Shape s11 = BRepPrimAPI_MakeBox(pp2, pp8);
........
Sorry! False! This Line:
......
BRepAlgoAPI_Fuse c10(s11, s10);
The Problem is BRepAlgoAPI_Fuse or BRepAlgo_Fuse,
They don't work correctlly, or don't work with various Shapes.