]> OCCT Git - occt.git/commitdiff
0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transfo...
authorkgv <kgv@opencascade.com>
Tue, 9 Nov 2021 12:17:43 +0000 (15:17 +0300)
committerkgv <kgv@opencascade.com>
Fri, 19 Nov 2021 07:13:36 +0000 (10:13 +0300)
SelectMgr_RectangularFrustum::OverlapsCylinder() - added missing 3D point transformation.
StdSelect_BRepSelectionTool::ComputeSensitive() - fixed cylinder height computation on TopoDS_Shape with scale transformation.
SelectMgr_AxisIntersector::OverlapsCylinder(),::OverlapsSphere() - added missing computations of surface normal.

22 files changed:
src/SelectMgr/SelectMgr_AxisIntersector.cxx
src/SelectMgr/SelectMgr_RectangularFrustum.cxx
src/StdSelect/StdSelect_BRepSelectionTool.cxx
tests/vselect/cone_cylinder/begin [deleted file]
tests/vselect/cone_cylinder/check_depth
tests/vselect/cone_cylinder/detecting
tests/vselect/cone_cylinder/generate_images
tests/vselect/cone_cylinder/polygon_selection
tests/vselect/cone_cylinder/rectangle_selection
tests/vselect/cone_cylinder/single_click_selection_cone
tests/vselect/cone_cylinder/single_click_selection_cylinder
tests/vselect/cone_cylinder/single_click_selection_trunc_cone
tests/vselect/cone_cylinder/trsf_cone [new file with mode: 0644]
tests/vselect/cone_cylinder/trsf_cyl [new file with mode: 0644]
tests/vselect/sphere/begin [deleted file]
tests/vselect/sphere/check_depth
tests/vselect/sphere/detecting
tests/vselect/sphere/generate_images
tests/vselect/sphere/polygon_selection
tests/vselect/sphere/rectangle_selection
tests/vselect/sphere/single_click_selection
tests/vselect/sphere/trsf [new file with mode: 0644]

index ec276943810071ef5d501344d9988d4ca9296331..f6660a035decea1c4c18e7867194e8f897f5dd3f 100644 (file)
@@ -543,7 +543,11 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsSphere (const gp_Pnt& theCen
     return Standard_False;
   }
 
+  const gp_Pnt aPntOnSphere (myAxis.Location().XYZ() + myAxis.Direction().XYZ() * aDepth);
+  const gp_Vec aNormal (aPntOnSphere.XYZ() - theCenter.XYZ());
   thePickResult.SetDepth (aDepth);
+  thePickResult.SetPickedPoint (aPntOnSphere);
+  thePickResult.SetSurfaceNormal (aNormal);
   return Standard_True;
 }
 
@@ -576,7 +580,22 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCylinder (const Standard_Rea
   {
     return false;
   }
+
+  const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aDepth;
   thePickResult.SetDepth (aDepth);
+  thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
+  if (Abs (aPntOnCylinder.Z()) < Precision::Confusion())
+  {
+    thePickResult.SetSurfaceNormal (-gp::DZ().Transformed (theTrsf));
+  }
+  else if (Abs (aPntOnCylinder.Z() - theHeight) < Precision::Confusion())
+  {
+    thePickResult.SetSurfaceNormal (gp::DZ().Transformed (theTrsf));
+  }
+  else
+  {
+    thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
+  }
   return true;
 }
 
index 44354f1f84a83274f9abefddf14bbf33f553cad5..12f45aac66eca621add45fb871f3b0bc24005891 100644 (file)
@@ -753,20 +753,24 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCylinder (const Standard_
 {
   Standard_ASSERT_RAISE (mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
     "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
-  Standard_Real aTimeEnter = 0.0, aTimeLeave = 0.0;
+  Standard_Real aTimes[2] = { 0.0, 0.0 };
   const gp_Trsf aTrsfInv = theTrsf.Inverted();
   const gp_Pnt  aLoc     = myNearPickedPnt.Transformed (aTrsfInv);
   const gp_Dir  aRayDir  = myViewRayDir   .Transformed (aTrsfInv);
-  if (!RayCylinderIntersection (theBottomRad, theTopRad, theHeight, aLoc, aRayDir, aTimeEnter, aTimeLeave))
+  if (!RayCylinderIntersection (theBottomRad, theTopRad, theHeight, aLoc, aRayDir, aTimes[0], aTimes[1]))
   {
     return Standard_False;
   }
-  thePickResult.SetDepth (aTimeEnter * myScale);
+
+  Standard_Integer aResTime = 0;
+  thePickResult.SetDepth (aTimes[aResTime] * myScale);
   if (theClipRange.IsClipped (thePickResult.Depth()))
   {
-    thePickResult.SetDepth (aTimeLeave * myScale);
+    aResTime = 1;
+    thePickResult.SetDepth (aTimes[aResTime] * myScale);
   }
-  const gp_Pnt aPntOnCylinder (aLoc.XYZ() + aRayDir.XYZ() * thePickResult.Depth());
+
+  const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aTimes[aResTime];
   if (Abs (aPntOnCylinder.Z()) < Precision::Confusion())
   {
     thePickResult.SetSurfaceNormal (-gp::DZ().Transformed (theTrsf));
@@ -779,7 +783,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCylinder (const Standard_
   {
     thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
   }
-  thePickResult.SetPickedPoint (aPntOnCylinder);
+  thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
   return !theClipRange.IsClipped (thePickResult.Depth());
 }
 
index ce3ecbf5be620cc22a8c9495e1a3472b9fe702ac..c62dc54462a443e62041c734110eb3e67416f044 100644 (file)
@@ -280,11 +280,11 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
           &TopoDS::Face (aSubfacesMap.FindKey (2))
         };
 
-        TopLoc_Location aLocSurf;
+        TopLoc_Location aLocSurf[2];
         const Handle(Geom_Surface)* aSurfaces[2] =
         {
-          &BRep_Tool::Surface (*aFaces[0], aLocSurf),
-          &BRep_Tool::Surface (*aFaces[1], aLocSurf)
+          &BRep_Tool::Surface (*aFaces[0], aLocSurf[0]),
+          &BRep_Tool::Surface (*aFaces[1], aLocSurf[1])
         };
 
         Standard_Integer aConIndex = 0;
@@ -308,7 +308,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
           const Standard_Real aRad1 = aCone.RefRadius();
           const Standard_Real aHeight = (aRad1 != 0.0)
                                        ? aRad1 / Abs (Tan (aCone.SemiAngle()))
-                                       : aCone.Location().Distance (aGeomPln->Location());
+                                       : aCone.Location().Distance (aGeomPln->Location().Transformed (aLocSurf[aConIndex == 0 ? 1 : 0]));
           const Standard_Real aRad2 = (aRad1 != 0.0) ? 0.0 : Tan (aCone.SemiAngle()) * aHeight;
           gp_Trsf aTrsf;
           aTrsf.SetTransformation (aCone.Position(), gp_Ax3());
@@ -326,18 +326,19 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
           &TopoDS::Face (aSubfacesMap.FindKey (3))
         };
 
-        TopLoc_Location aLocSurf;
+        TopLoc_Location aLocSurf[3];
         const Handle(Geom_Surface)* aSurfaces[3] =
         {
-          &BRep_Tool::Surface (*aFaces[0], aLocSurf),
-          &BRep_Tool::Surface (*aFaces[1], aLocSurf),
-          &BRep_Tool::Surface (*aFaces[2], aLocSurf)
+          &BRep_Tool::Surface (*aFaces[0], aLocSurf[0]),
+          &BRep_Tool::Surface (*aFaces[1], aLocSurf[1]),
+          &BRep_Tool::Surface (*aFaces[2], aLocSurf[2])
         };
 
         Standard_Integer aConIndex = -1, aNbPlanes = 0;
         Handle(Geom_ConicalSurface) aGeomCone;
         Handle(Geom_CylindricalSurface) aGeomCyl;
         Handle(Geom_Plane) aGeomPlanes[2];
+        const TopLoc_Location* aGeomPlanesLoc[2];
         for (Standard_Integer aSurfIter = 0; aSurfIter < 3; ++aSurfIter)
         {
           const Handle(Geom_Surface)& aSurf = *aSurfaces[aSurfIter];
@@ -361,6 +362,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
             aGeomPlanes[aNbPlanes] = Handle(Geom_Plane)::DownCast (aSurf);
             if (!aGeomPlanes[aNbPlanes].IsNull())
             {
+              aGeomPlanesLoc[aNbPlanes] = &aLocSurf[aSurfIter];
               ++aNbPlanes;
             }
           }
@@ -375,7 +377,8 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
           {
             const gp_Cone aCone = BRepAdaptor_Surface (*aFaces[aConIndex]).Cone();
             const Standard_Real aRad1 = aCone.RefRadius();
-            const Standard_Real aHeight = aGeomPlanes[0]->Location().Distance (aGeomPlanes[1]->Location());
+            const Standard_Real aHeight = aGeomPlanes[0]->Location().Transformed (*aGeomPlanesLoc[0])
+                               .Distance (aGeomPlanes[1]->Location().Transformed (*aGeomPlanesLoc[1]));
             gp_Trsf aTrsf;
             aTrsf.SetTransformation (aCone.Position(), gp_Ax3());
             const Standard_Real aTriangleHeight = (aCone.SemiAngle() > 0.0)
@@ -398,7 +401,8 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
           {
             const gp_Cylinder aCyl = BRepAdaptor_Surface (*aFaces[aConIndex]).Cylinder();
             const Standard_Real aRad = aCyl.Radius();
-            const Standard_Real aHeight = aGeomPlanes[0]->Location().Distance (aGeomPlanes[1]->Location());
+            const Standard_Real aHeight = aGeomPlanes[0]->Location().Transformed (*aGeomPlanesLoc[0])
+                               .Distance (aGeomPlanes[1]->Location().Transformed (*aGeomPlanesLoc[1]));
             gp_Trsf aTrsf;
             aTrsf.SetTransformation (aCyl.Position(), gp_Ax3());
             Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad, aRad, aHeight, aTrsf);
@@ -410,7 +414,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
 
       for (Standard_Integer aShIndex = 1; aShIndex <= aSubfacesMap.Extent(); ++aShIndex)
       {
-        ComputeSensitive (aSubfacesMap (aShIndex), theOwner,
+        ComputeSensitive (aSubfacesMap.FindKey (aShIndex), theOwner,
                           theSelection,
                           theDeflection, theDeviationAngle, theNbPOnEdge, theMaxParam, isAutoTriangulation);
       }
diff --git a/tests/vselect/cone_cylinder/begin b/tests/vselect/cone_cylinder/begin
deleted file mode 100644 (file)
index 26ce000..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-vinit View1 -height 400 -width 600
-set subgroup "cone_cylinder"
index f4ba540ad1fb1dd1342173d21ba22a865d9ed5b4..d3d8df71f3ea05ea7977552c6821dc91d5b80c46 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests depth value returned by Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder cyl 10 20
 vdisplay cyl -dispmode 1
 vfit
index 0608ca670c4f80c786c93ba2b10a40fb52237585..8372576033eebe6e1e4659f0df718524ca834784 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests detecting Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder cyl 10 20
 vdisplay cyl -dispmode 1
 vfit
index 5bc5d10b1d05b0d3896fef2944f2190fc7cac145..787fb07c6e7bc4a21d994c11064246c102cfb732 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Generating images based on detection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder cyl 10 20
 vdisplay cyl -dispmode 1
 vfit
index 1f5ae6a65d04baea92265be4b405e22dc2821ee9..56e26fdbbf81d2ec009e53f7659f22a17ec0c6de 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests polygon selection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder c1 10 20
 pcone c2 10 0 20
 pcone c3 10 5 10
index 6fa39a78777d9136edf1bbe129b220d83dcedd84..3667a81d4fffc208e3ab57c2498999d445434f73 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests rectangular selection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder c1 10 20
 pcone c2 10 0 20
 pcone c3 10 5 10
index 9dc996baedecd8dcbf6486c79f18e804abbb1c93..bd30de6825a8922c03ceaff29aaebedc20b34901 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests selection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcone cone 10 0 20
 vdisplay cone -dispmode 1
 vfit
index 15148b8a3097274501287fcd57114768f5a237cf..f391802dadaca224725593d804c47e88045d77be 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests selection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcylinder cyl 10 20
 vdisplay cyl -dispmode 1
 vfit
index 315910e8b138c401def48d850b477ab4fa4d3b25..6ce8decb5b8ec1bbd5fe7e921359169523477dcc 100644 (file)
@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
 puts "Tests selection of Select3D_SensitiveCylinder"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 pcone tr_cone 10 5 10
 vdisplay tr_cone -dispmode 1
 vfit
diff --git a/tests/vselect/cone_cylinder/trsf_cone b/tests/vselect/cone_cylinder/trsf_cone
new file mode 100644 (file)
index 0000000..a87ecd5
--- /dev/null
@@ -0,0 +1,40 @@
+puts "================================="
+puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
+puts "Check picking of transformed cone"
+puts "================================="
+
+pload MODELING VISUALIZATION
+pcone      c 10 5 10
+fscale     c 0 0 0 0.1
+trotate    c 0 0 0 1 1 0 25
+ttranslate c 2500 3500 1000
+
+vinit View1
+
+# check Select3D_SensitiveTriangulation
+vclear
+vaxo
+compound {*}[explode c Sh] cc
+vdisplay -dispmode 1 cc
+vfit
+vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
+set aPntTris [vmoveto 200 200]
+vpoint pp {*}$aPntTris
+checkpoint aPntTris_p $aPntTris {2500.42 3499.54 1000.81} 0.1
+if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_tris.png
+vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
+
+# check Select3D_SensitiveCylinder
+vclear
+vdisplay -dispmode 1 c
+vfit
+vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
+set aPntCone [vmoveto 200 200]
+vpoint pp {*}$aPntCone
+checkpoint aPntCone_p $aPntCone {2500.42 3499.54 1000.81} 0.1
+if { ![string match "*Select3D_SensitiveCylinder*" [vstate -entities]] } { puts "Error: cylinder should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_cyl.png
+vseldump $imagedir/${casename}_selnorm_cyl.png -type surfNormal
diff --git a/tests/vselect/cone_cylinder/trsf_cyl b/tests/vselect/cone_cylinder/trsf_cyl
new file mode 100644 (file)
index 0000000..6711eb2
--- /dev/null
@@ -0,0 +1,40 @@
+puts "================================="
+puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
+puts "Check picking of transformed cylinder"
+puts "================================="
+
+pload MODELING VISUALIZATION
+pcylinder  c 10 20
+fscale     c 0 0 0 0.1
+trotate    c 0 0 0 1 1 0 25
+ttranslate c 2500 3500 1000
+
+vinit View1
+
+# check Select3D_SensitiveTriangulation
+vclear
+vaxo
+compound {*}[explode c Sh] cc
+vdisplay -dispmode 1 cc
+vfit
+vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
+set aPntTris [vmoveto 200 200]
+vpoint pp {*}$aPntTris
+checkpoint aPntTris_p $aPntTris {2500.9 3499.0 1001.6} 0.1
+if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_tris.png
+vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
+
+# check Select3D_SensitiveCylinder
+vclear
+vdisplay -dispmode 1 c
+vfit
+vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
+set aPntCyl [vmoveto 200 200]
+vpoint pp {*}$aPntCyl
+checkpoint aPntCyl_p $aPntCyl {2500.9 3499.0 1001.6} 0.1
+if { ![string match "*Select3D_SensitiveCylinder*" [vstate -entities]] } { puts "Error: cylinder should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_cyl.png
+vseldump $imagedir/${casename}_selnorm_cyl.png -type surfNormal
diff --git a/tests/vselect/sphere/begin b/tests/vselect/sphere/begin
deleted file mode 100644 (file)
index 0442e42..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-vinit View1 -height 400 -width 600
-set subgroup "sphere"
index 6d38a5b922320df47b4a76dad2efdd06c544a84f..4a4c0a38d30445691141ddd24864cbce458cf52a 100644 (file)
@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
 puts "Tests depth value returned by Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s 1
 vdisplay -dispMode 1 s
 vfit
index a42120b84267539996caa9f19eb1886377e59647..885b94734d94b7f314ebc5775568d9e796899f7d 100644 (file)
@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
 puts "Tests detecting Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s 1
 vdisplay -dispMode 1 s
 vfit
index 929fbff63335ce511d1f8ed6a689e61c66bd2efc..407f7f09d68c3082c853e45d81af332327c711a0 100644 (file)
@@ -3,6 +3,9 @@ puts "000032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add opt
 puts "Generating images based on detection of Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s 1
 vdisplay -dispMode 1 s
 vfit
index c1cc47fe1cb25aa7686f9f15adc55043aeabcbb6..733e3ce541a7b403e311591402469a392ba0a342 100644 (file)
@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
 puts "Tests polygon selection of Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s1 1
 psphere s2 1
 psphere s3 1
index 87d7555d4e50205e982499a6884ba8023c65ea0e..f62b221edf97af226200f074443cddbb3ee5b067 100644 (file)
@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
 puts "Tests rectangular selection of Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s1 1
 psphere s2 1
 psphere s3 1
index d65469b7a1d5664ce1c3ca1178bc3cf9aafb37f5..cc216ccfb6be7a9520526ff092ba5cb9c727f23c 100644 (file)
@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
 puts "Tests selection of Select3D_SenstiveSphere"
 puts "================================="
 
+pload MODELING VISUALIZATION
+vinit View1 -height 400 -width 600
+
 psphere s 1
 vdisplay -dispMode 1 s
 vfit
diff --git a/tests/vselect/sphere/trsf b/tests/vselect/sphere/trsf
new file mode 100644 (file)
index 0000000..ceefc1f
--- /dev/null
@@ -0,0 +1,43 @@
+puts "================================="
+puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
+puts "Check picking of transformed sphere"
+puts "================================="
+
+pload MODELING VISUALIZATION
+psphere    s 10
+fscale     s 0 0 0 0.1
+trotate    s 0 0 0 1 1 0 25
+ttranslate s 2500 3500 1000
+
+vinit View1
+vlight headlight -head 0
+
+# check Select3D_SensitiveTriangulation
+vclear
+vaxo
+tcopy s ss
+incmesh ss 1.0
+tclean  ss -geom
+vdisplay -dispmode 1 ss
+vfit
+vselaxis 2500 3498 1000 0 1 0 -display a -showNormal
+set aPntTris [vmoveto 200 200]
+vpoint pp {*}$aPntTris
+checkpoint aPntTris_p $aPntTris {2500.54 3499.41 1000.6} 0.1
+if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_tris.png
+vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
+
+# check Select3D_SensitiveSphere
+vclear
+vdisplay -dispmode 1 s
+vfit
+vselaxis 2500 3498 1000 0 1 0 -display a -showNormal
+set aPntSph [vmoveto 200 200]
+vpoint pp {*}$aPntSph
+checkpoint aPntSph_p $aPntSph {2500.54 3499.41 1000.6} 0.1
+if { ![string match "*Select3D_SensitiveSphere*" [vstate -entities]] } { puts "Error: sphere should be detected" }
+vfit
+vdump $imagedir/${casename}_prs_sph.png
+vseldump $imagedir/${casename}_selnorm_sph.png -type surfNormal