]> OCCT Git - occt-copy.git/commitdiff
0026955: Invalid result of General Fuse operation CR26955-691
authoremv <emv@opencascade.com>
Tue, 8 Dec 2015 15:06:13 +0000 (18:06 +0300)
committeremv <emv@opencascade.com>
Tue, 8 Dec 2015 15:06:13 +0000 (18:06 +0300)
Running Solid Classifier algorithm with correct tolerance for point. Patch for 6.9.1 version of OCCT.

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

index d49be1bdec68c2d4cbd133719f5c71466223def8..fc67053302bf954de54d1163bb3454a306a03400 100644 (file)
@@ -17,6 +17,8 @@
 #include <Standard_DefineHandle.hxx>
 #include <MMgt_TShared.hxx>
 //
+#include <Precision.hxx>
+//
 #include <NCollection_Vector.hxx>
 #include <NCollection_Map.hxx>
 //
@@ -82,6 +84,7 @@ class BRepCheck_ToolSolid  {
 
   BRepCheck_ToolSolid() {
     myIsHole=Standard_False;
+    myPntTol=Precision::Confusion();
     myPnt.SetCoord(-1.,-1.,-1.);
   };
    
@@ -104,6 +107,10 @@ class BRepCheck_ToolSolid  {
     return myPnt;
   }
   //
+  Standard_Real CheckTol() const {
+    return myPntTol;
+  };
+  //
   // IsOut
   Standard_Boolean IsOut(BRepCheck_ToolSolid& aOther)  {
     Standard_Boolean bFlag;
@@ -111,7 +118,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);
     //
@@ -143,6 +150,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;
       }
     }
@@ -151,6 +159,7 @@ class BRepCheck_ToolSolid  {
  protected:
   Standard_Boolean myIsHole;
   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