]> OCCT Git - occt.git/commitdiff
0026955: Invalid result of General Fuse operation
authoremv <emv@opencascade.com>
Tue, 8 Dec 2015 15:05:07 +0000 (18:05 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Dec 2015 12:59:59 +0000 (15:59 +0300)
Running Solid Classifier algorithm with correct tolerance for point.

src/BRepCheck/BRepCheck_Solid.cxx
tests/bugs/modalg_6/bug26955 [new file with mode: 0644]

index a6d5e648a9d354a38d78cf5a6e2e0ef4513a0b80..3306aad9737e2c775dab0bb3bcec46e834ac9e3a 100644 (file)
@@ -23,6 +23,7 @@
 #include <MMgt_TShared.hxx>
 #include <NCollection_Map.hxx>
 #include <NCollection_Vector.hxx>
+#include <Precision.hxx>
 #include <Standard_Type.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS_Builder.hxx>
 
 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 (file)
index 0000000..9bf5c96
--- /dev/null
@@ -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