0026317: Visualization - AIS_LengthDimension::CheckPlane() is incorrect
authorisk <isk@opencascade.com>
Thu, 20 Aug 2015 05:46:25 +0000 (08:46 +0300)
committerski <ski@opencascade.com>
Thu, 27 Aug 2015 12:30:13 +0000 (15:30 +0300)
src/AIS/AIS_LengthDimension.cxx
tests/bugs/vis/bug26317 [new file with mode: 0644]

index ac481c0..d5566de 100755 (executable)
@@ -188,8 +188,11 @@ void AIS_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape,
 //=======================================================================
 Standard_Boolean AIS_LengthDimension::CheckPlane (const gp_Pln& thePlane) const
 {
-  if (!thePlane.Contains (myFirstPoint, Precision::Confusion()) &&
-      !thePlane.Contains (mySecondPoint, Precision::Confusion()))
+  Standard_Boolean anIsFaultyNormal =
+    thePlane.Axis().Direction().IsParallel(gce_MakeDir (myFirstPoint, mySecondPoint), Precision::Angular());
+
+  if ((!thePlane.Contains (myFirstPoint, Precision::Confusion()) && !thePlane.Contains (mySecondPoint, Precision::Confusion()))
+   || anIsFaultyNormal)
   {
     return Standard_False;
   }
diff --git a/tests/bugs/vis/bug26317 b/tests/bugs/vis/bug26317
new file mode 100644 (file)
index 0000000..2b5b013
--- /dev/null
@@ -0,0 +1,21 @@
+puts "============"
+puts "CR26317"
+puts "============"
+puts ""
+
+##########################################################################################
+puts "Visualization, AIS_LengthDimension::CheckPlane is incorrect"
+##########################################################################################
+
+pload VISUALIZATION MODELING
+
+box b 100 200 300
+vinit View1
+vclear
+vaxo
+explode b F
+vdisplay b_1 b_2
+vdimension len -length -shapes b_1 b_2 -plane zox
+vfit
+
+vdump ${imagedir}/${casename}.png