From b08044878089762799992ddfe4b21c0703de462e Mon Sep 17 00:00:00 2001 From: isk Date: Thu, 20 Aug 2015 08:46:25 +0300 Subject: [PATCH] 0026317: Visualization - AIS_LengthDimension::CheckPlane() is incorrect --- src/AIS/AIS_LengthDimension.cxx | 7 +++++-- tests/bugs/vis/bug26317 | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/vis/bug26317 diff --git a/src/AIS/AIS_LengthDimension.cxx b/src/AIS/AIS_LengthDimension.cxx index ac481c09d2..d5566def7d 100755 --- a/src/AIS/AIS_LengthDimension.cxx +++ b/src/AIS/AIS_LengthDimension.cxx @@ -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 index 0000000000..2b5b013498 --- /dev/null +++ b/tests/bugs/vis/bug26317 @@ -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