View Issue Details

IDProjectCategoryView StatusLast Update
0001077CommunityOCCT:Modeling Algorithmspublic2011-12-15 17:50
ReporteremoAssigned Toofv 
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Fixed in Version5.1.1 
Summary0001077: BUG in boolean operations in the development version
DescriptionThis bug has been added by Stephane Routelous stephane.routelous@exotk.org at
http://www.opencascade.org/forumorg/bug.php?bug_id=99&f=8 .

--------------

Hi,

I have some code working fine under OpenCASCADE 4.0 "official", which causes a
crash with the new boolean operations in the development version.

I attach with this bug the .brep done with OCC4.0 and a screenshot of the shape
shaded in a viewer.

BTW, the function boolbl is taken from Draw .

Here is the code :
#ifndef _ShapeExtend_Status_HeaderFile
#include
#endif
#ifndef _ShapeFix_Shape_HeaderFile
#include
#endif
#ifndef _BRepPrimAPI_MakeBox_HeaderFile
#include
#endif
#ifndef _BRepPrimAPI_MakeSphere_HeaderFile
#include
#endif
#ifndef _BRepAlgoAPI_Common_HeaderFile
#include
#endif
#ifndef _BRepPrimAPI_MakeCylinder_HeaderFile
#include
#endif
#ifndef _BRepAlgoAPI_Cut_HeaderFile
#include
#endif
#ifndef _TopTools_ListIteratorOfListOfShape_HeaderFile
#include
#endif
#ifndef _TopoDS_Compound_HeaderFile
#include
#endif
#ifndef _TopExp_Explorer_HeaderFile
#include
#endif
#ifndef _BRepFilletAPI_MakeFillet_HeaderFile
#include
#endif
#ifndef _TopOpeBRepBuild_HBuilder_HeaderFile
#include
#endif
#ifndef _TopoDS_HeaderFile
#include
#endif
#ifndef _BRepTools_HeaderFile
#include
#endif
#ifndef _TopoDS_Solid_HeaderFile
#include
#endif
#ifndef _BRepTools_HeaderFile
#include
#endif


#define OCC40
/**
* \fn boolbl(const BRepAlgoAPI_BooleanOperation& aBoolenaOperation,const
Standard_Real aRadius)
* \brief create a blend on \a aBoolenaOperation
* \return TopoDS_Shape
* \param aBoolenaOperation const BRepAlgoAPI_BooleanOperation&
* \param aRadius const Standard_Real
*/
TopoDS_Shape boolbl(const BRepAlgoAPI_BooleanOperation& aBoolenaOperation,const
Standard_Real aRadius)
{
Standard_Real t3d = 1.e-4;
Standard_Real t2d = 1.e-5;
Standard_Real ta = 1.e-2;
Standard_Real fl = 1.e-3;
Standard_Real tapp_angle = 1.e-2;
GeomAbs_Shape blend_cont = GeomAbs_C1;

TopoDS_Shape ShapeCut = aBoolenaOperation.Shape();

#ifdef OCC40
Handle_TopOpeBRepBuild_HBuilder build = aBoolenaOperation.Builder();
#endif
TopTools_ListIteratorOfListOfShape its;

TopoDS_Compound result;
BRep_Builder B;
B.MakeCompound(result);

TopExp_Explorer ex;
for (ex.Init(ShapeCut, TopAbs_SOLID); ex.More(); ex.Next())
{
const TopoDS_Shape& cutsol = ex.Current();

BRepFilletAPI_MakeFillet fill(cutsol);
fill.SetParams(ta, t3d, t2d, t3d, t2d, fl);
fill.SetContinuity(blend_cont, tapp_angle);
#ifdef OCC40
its = build->Section();
#else //OCC40DEV
its = aBoolenaOperation.SectionEdges();
#endif
while (its.More())
{
TopoDS_Edge E = TopoDS::Edge(its.Value());
fill.Add(aRadius, E);
its.Next();
}

fill.Build();
if (fill.IsDone())
{
B.Add(result, fill.Shape());
}
else
{
B.Add(result, cutsol);
}
}
return result;
}

TopoDS_Shape cut_blend(const TopoDS_Shape& aShapeToCut, const TopoDS_Shape&
aTool, const Standard_Real aRadius)
{
return boolbl(BRepAlgoAPI_Cut(aShapeToCut, aTool),aRadius);
}

TopoDS_Shape common_blend(const TopoDS_Shape& aShape1, const TopoDS_Shape&
aShape2, const Standard_Real aRadius)
{
return boolbl(BRepAlgoAPI_Common(aShape1, aShape2),aRadius);
}

TopoDS_Shape Bug()
{
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(gp_Pnt(-5, - 5, - 5), 10, 10, 10);
TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(7);

TopoDS_Shape theCommon = BRepAlgoAPI_Common(theBox,theSphere);
TopoDS_Shape theCylinder1 = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, - 10),
gp_Dir(0, 0, 1)), 3, 20);
TopoDS_Shape theCylinder2 = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-10, 0, 0),
gp_Dir(1, 0, 0)), 3, 20);
TopoDS_Shape theCylinder3 = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, - 10, 0),
gp_Dir(0, 1, 0)), 3, 20);
TopoDS_Shape theTmp1 = cut_blend(theCommon,theCylinder1,0.7);
Handle_ShapeFix_Shape fixer = new ShapeFix_Shape(theTmp1);
fixer->Perform();
theTmp1 = fixer->Shape();
TopoDS_Shape theTmp2 = cut_blend(theTmp1,theCylinder2,0.7);
fixer->Init(theTmp2);
fixer->Perform();
theTmp2 = fixer->Shape();
TopoDS_Shape theResult = cut_blend(theTmp2,theCylinder3,0.7);
fixer->Init(theResult);
fixer->Perform();
theResult = fixer->Shape();
return theResult;

}

int main(int argc, char* argv[])
{
TopoDS_Shape S = Bug();
BRepTools::Write(S,"bug.brep");
return 0;
}

--------------

See the files attached
TagsNo tags attached.
Test case number

Attached Files

  • bugBOP.jpeg (14,564 bytes)
  • bugBOP.brep (361,425 bytes)
  • ofv-1077-v1.tar.gz (5,520 bytes)
  • ofv-occ1077-v2.tar.gz (3,188 bytes)

Activities

2002-12-02 09:54

 

bugBOP.jpeg (14,564 bytes)

2002-12-02 09:57

 

bugBOP.brep (361,425 bytes)

2003-07-09 13:34

 

ofv-1077-v1.tar.gz (5,520 bytes)

2003-08-08 12:47

 

ofv-occ1077-v2.tar.gz (3,188 bytes)

Issue History

Date Modified Username Field Change
2003-06-25 08:44 bugmaster Assigned To bugmaster => ofv
2003-06-25 08:44 bugmaster Status new => assigned
2003-07-09 15:35 ofv Status assigned => resolved
2003-07-25 12:42 bugmaster CC => apv
2003-07-29 11:28 enk CC => enk, aki
2003-08-08 14:55 bugmaster CC =>
2003-08-12 15:15 apv CC => apv
2003-08-14 11:25 aki Status resolved => tested
2003-08-18 12:03 bugmaster Status tested => verified
2003-10-17 11:20 bugmaster Status verified => closed
2003-10-17 11:20 bugmaster Fixed in Version => 5.1.1
2003-10-17 11:20 bugmaster Resolution @0@ => fixed
2011-08-02 11:31 bugmaster Category OCCT:MOA => OCCT:Modeling Algorithms
2011-12-15 17:50 bugmaster Project Open CASCADE => Community