0030243: Regression in HLR PolyAlgo in OCCT 7.1.0
authorabk <abk@opencascade.com>
Wed, 31 Oct 2018 16:04:57 +0000 (19:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 7 Nov 2018 15:17:59 +0000 (18:17 +0300)
The misprint leading to the problems was fixed.

"Draw" tests were created to check the fix.

"Draw" test bugs/modalg_7/bug28784 was corrected
for right changes of the results.

src/HLRAlgo/HLRAlgo_PolyData.cxx
tests/bugs/modalg_7/bug28784
tests/bugs/modalg_7/bug29956 [new file with mode: 0644]
tests/bugs/modalg_7/bug30243 [new file with mode: 0644]

index 333920e7238c8a58660c933372a1748b5ad81dc9..95d4fbdbaffd34ffb7da9e2dca4e7da384cfeb0a 100644 (file)
@@ -470,7 +470,7 @@ void HLRAlgo_PolyData::hideByOneTriangle (const HLRAlgo_BiPoint::PointsT& thePoi
     if (d2 < 0) ad2 = -d2;
     pp = ad1 / ( ad1 + ad2 );
     if (TrFlags & HLRAlgo_PolyMask_EMskGrALin2)
-      pdp = (thePoints.PntP1.X() + (thePoints.Pnt2.X() - thePoints.PntP1.X()) * pp - theTriangle.V2.X()) / aD.X();
+      pdp = (thePoints.PntP1.X() + (thePoints.PntP2.X() - thePoints.PntP1.X()) * pp - theTriangle.V2.X()) / aD.X();
     else
       pdp = (thePoints.PntP1.Y() + (thePoints.PntP2.Y() - thePoints.PntP1.Y()) * pp - theTriangle.V2.Y()) / aD.Y();
     Standard_Boolean OutSideP = Standard_False;
index 5289bd6460b14e15863d0c5becff2612821f8c08..2ae78b2a2ac93e45364d2a919c943c33f3165ff0 100755 (executable)
@@ -11,7 +11,7 @@ pload QAcommands
 restore [locate_data_file bug28784_MHX_SKG_MS_Pos1_simplified.brep] a
 OCC28784 result a
 
-checknbshapes result -edge 236
+checknbshapes result -edge 235
 
 smallview
 top
diff --git a/tests/bugs/modalg_7/bug29956 b/tests/bugs/modalg_7/bug29956
new file mode 100644 (file)
index 0000000..f7cdcb4
--- /dev/null
@@ -0,0 +1,14 @@
+puts "========"
+puts "0029956: HLR polygonal algorithm: regression in 7.1 relative to 7.0"
+puts "========"
+puts ""
+
+pload XSDRAW
+testreadstep [locate_data_file example_auto_tooling_01.stp] s
+vinit
+vdisplay s
+vfit
+vhlrtype polyAlgo s
+vhlr on
+
+vdump ${imagedir}/${casename}.png
diff --git a/tests/bugs/modalg_7/bug30243 b/tests/bugs/modalg_7/bug30243
new file mode 100644 (file)
index 0000000..8dc1423
--- /dev/null
@@ -0,0 +1,14 @@
+puts "========"
+puts "0030243: Regression in HLR PolyAlgo in OCCT 7.1.0"
+puts "========"
+puts ""
+
+pload XSDRAW
+testreadstep [locate_data_file BFC_10000.stp] s
+vinit
+vdisplay s
+vfit
+vhlrtype polyAlgo s
+vhlr on
+
+vdump ${imagedir}/${casename}.png