]> OCCT Git - occt-copy.git/commitdiff
0026251: Section curve cannot be found
authornbv <nbv@opencascade.com>
Tue, 1 Sep 2015 07:39:43 +0000 (10:39 +0300)
committerabv <abv@opencascade.com>
Wed, 2 Sep 2015 22:56:22 +0000 (01:56 +0300)
Current algorithm ignores found triangles intersection (IntPolyh_PMaillageAffinage) and, consequently, cannot find start point for intersection line. Branch fixes this problem.

Test case for issue CR26251

src/IntPolyh/IntPolyh_Intersection.cxx
src/IntPolyh/IntPolyh_Intersection_1.cxx
tests/bugs/modalg_6/bug26251 [new file with mode: 0755]

index 1d4ce2e99ff6003a77710ea372045fad68f8dcdd..153507e341d66041ac90c19d1219e98eb1e5ef56 100644 (file)
@@ -88,7 +88,7 @@ void IntPolyh_Intersection::Perform() {
     isAdvDone = PerformAdv(aPMaillageFF,aPMaillageFR,aPMaillageRF,aPMaillageRR,nbCouplesAdv);
 
     // advanced interference found
-    if(isAdvDone && nbCouplesAdv > 10) {
+    if(isAdvDone && nbCouplesAdv > 0) {
       aPMaillageFF->StartPointsChain(TSectionLines,TTangentZones);
       aPMaillageFR->StartPointsChain(TSectionLines,TTangentZones);
       aPMaillageRF->StartPointsChain(TSectionLines,TTangentZones);
index e5f949e05ad7d8f119d04f3aefcfaaffe6e98df4..c945bb3278a3d2b3983add1f56ccb5b570824c48 100644 (file)
@@ -85,7 +85,7 @@ void IntPolyh_Intersection::Perform(const TColStd_Array1OfReal& Upars1,
                             aPMaillageRR,nbCouplesAdv);
       
     // advanced interference found
-    if(isAdvDone && nbCouplesAdv > 10) {
+    if(isAdvDone && nbCouplesAdv > 0) {
       aPMaillageFF->StartPointsChain(TSectionLines,TTangentZones);
       aPMaillageFR->StartPointsChain(TSectionLines,TTangentZones);
       aPMaillageRF->StartPointsChain(TSectionLines,TTangentZones);
@@ -169,7 +169,7 @@ Standard_Boolean IntPolyh_Intersection::PerformMaillage(const Standard_Boolean i
      (FinTTC >= theMaillageS->GetArrayOfTriangles(1).NbTriangles() ||
       FinTTC >= theMaillageS->GetArrayOfTriangles(2).NbTriangles()) ) {
     return Standard_False;
-}
+  }
 */
 //IFV test for parallel surf
   if(FinTTC > 200) {
@@ -248,7 +248,7 @@ Standard_Boolean IntPolyh_Intersection::PerformMaillage(const TColStd_Array1OfRe
      (FinTTC >= theMaillageS->GetArrayOfTriangles(1).NbTriangles() ||
       FinTTC >= theMaillageS->GetArrayOfTriangles(2).NbTriangles()) ) {
     return Standard_False;
-}
+  }
 */
 //IFV test for parallel surf
   if(FinTTC > 200) {
diff --git a/tests/bugs/modalg_6/bug26251 b/tests/bugs/modalg_6/bug26251
new file mode 100755 (executable)
index 0000000..0f21c56
--- /dev/null
@@ -0,0 +1,43 @@
+puts "============"
+puts "OCC26251"
+puts "============"
+puts ""
+###############################
+## Section curve cannot be found
+###############################
+
+restore [locate_data_file bug26251_b31_3.brep] b1
+restore [locate_data_file bug26251_tank31.brep] b2
+
+bsection result b1 b2
+
+set length 2.49934
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 3
+ EDGE      : 2
+ WIRE      : 0
+ FACE      : 0
+ SHELL     : 0
+ SOLID     : 0
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 6
+"
+
+checknbshapes result -ref ${nbshapes_expected} -t -m "Section curve"
+
+explode b2 f
+copy b2_5 b2
+
+set NbCurves 0
+
+set log [bopcurves b1 b2 -2d]
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurves
+
+if {$NbCurves == 0} {
+  puts "Error: Intersection curve is not found"
+}
+
+set 3dviewer 1