diff --git a/src/BRepCheck/BRepCheck_Solid.cxx b/src/BRepCheck/BRepCheck_Solid.cxx index a6d5e648a9..3306aad973 100644 --- a/src/BRepCheck/BRepCheck_Solid.cxx +++ b/src/BRepCheck/BRepCheck_Solid.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -36,14 +37,6 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepCheck_Solid,BRepCheck_Result) -// -// -// -// -// -// -// -// // class BRepCheck_HSC; DEFINE_STANDARD_HANDLE(BRepCheck_HSC, MMgt_TShared); @@ -73,8 +66,6 @@ class BRepCheck_HSC : public MMgt_TShared { BRepClass3d_SolidClassifier mySC; }; - - // //======================================================================= //class : BRepCheck_ToolSolid @@ -87,6 +78,7 @@ class BRepCheck_ToolSolid { BRepCheck_ToolSolid() { myIsHole=Standard_False; + myPntTol=Precision::Confusion(); myPnt.SetCoord(-1.,-1.,-1.); }; @@ -109,6 +101,10 @@ class BRepCheck_ToolSolid { return myPnt; } // + Standard_Real CheckTol() const { + return myPntTol; + }; + // // IsOut Standard_Boolean IsOut(BRepCheck_ToolSolid& aOther) { Standard_Boolean bFlag; @@ -116,7 +112,7 @@ class BRepCheck_ToolSolid { // BRepClass3d_SolidClassifier& aSC=myHSC->SolidClassifier(); // - aSC.Perform(aOther.myPnt, ::RealSmall()); + aSC.Perform(aOther.InnerPoint(), aOther.CheckTol()); aState=aSC.State(); bFlag=(aState==TopAbs_OUT); // @@ -148,6 +144,7 @@ class BRepCheck_ToolSolid { Handle(Geom_Curve) aC3D=BRep_Tool::Curve(aE, aT1, aT2); aT=(1.-aPAR_T)*aT1 + aPAR_T*aT2; myPnt=aC3D->Value(aT); + myPntTol = BRep_Tool::Tolerance(aE); break; } } @@ -155,7 +152,8 @@ class BRepCheck_ToolSolid { // protected: Standard_Boolean myIsHole; - gp_Pnt myPnt; + gp_Pnt myPnt; + Standard_Real myPntTol; TopoDS_Solid mySolid; Handle(BRepCheck_HSC) myHSC; }; diff --git a/tests/bugs/modalg_6/bug26955 b/tests/bugs/modalg_6/bug26955 new file mode 100644 index 0000000000..9bf5c96e7f --- /dev/null +++ b/tests/bugs/modalg_6/bug26955 @@ -0,0 +1,37 @@ +puts "========" +puts "OCC26955" +puts "========" +puts "" +################################# +# Invalid result of General Fuse operation +################################# + + +restore [locate_data_file bug26955_input0.brep] b1 +restore [locate_data_file bug26955_input1.brep] b2 +restore [locate_data_file bug26955_input2.brep] b3 + +bclearobjects +bcleartools +baddobjects b1 b2 b3 +bfillds +bbuild result + +set square 24516.1 + +set nbshapes_expected " +Number of shapes in shape + VERTEX : 14 + EDGE : 22 + WIRE : 14 + FACE : 13 + SHELL : 4 + SOLID : 3 + COMPSOLID : 0 + COMPOUND : 1 + SHAPE : 71 +" + +checknbshapes result -ref ${nbshapes_expected} -t + +set 2dviewer 1