1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/tests/v3d/point_cloud/sensitivebox
age d31fb73a09 0030765: Visualization - Incorrect intersection with Select3D_SensitiveBox when clipping is turned on
SelectMgr_RectangularFrustum::Overlaps method for computing intersection of box with frustum was reworked. Now the nearest non-clipped point is calculated.
2019-06-07 15:02:39 +03:00

66 lines
1.5 KiB
Plaintext

puts "========"
puts "Sensitive box selection"
puts "========"
proc checkPoint {theName theValue theExpected} {
set e 0.0001
foreach i {0 1 2} { if { [expr abs([lindex $theValue $i] - [lindex $theExpected $i])] > $e } { puts "Error: wrong picked point $theName" } }
return
}
# create sphere
sphere ss 10
mkface s ss
incmesh s 0.01
# draw sphere
vinit View1
vclear
vsetdispmode 1
vpointcloud p s -nonormals
vselmode p 2 1
vaxo
vfit
vclipplane pl1 -set -equation -1 0 0 0
set p1 [vmoveto 200 200]
if {[string first "e+308" $p1] != -1} {
puts "Faulty : Selection 1"
}
vpoint pp1 {*}$p1
checkPoint pp1 $p1 {-1.7763568394002505e-15 -0.51078486684208357 0.59985611160264973}
vdump $::imagedir/${::casename}_clip1_selection_axo.png
vtop
vdump $::imagedir/${::casename}_clip1_selection_top.png
vaxo
verase pp1
vmoveto 300 200
vdump $::imagedir/${::casename}_clip1_no_selection.png
vclipplane pl1 -set -equation -1 0 0 3
vclipplane pl2 -set -equation 1 0 0 3
set p2 [vmoveto 200 200]
if {[string first "e+308" $p2] != -1} {
puts "Faulty : Selection 2"
}
vpoint pp2 {*}$p2
checkPoint pp2 $p2 {2.9999999999999991 -3.5107848668420845 3.5998561116026506}
vdump $::imagedir/${::casename}_clip2_selection_axo.png
vtop
vdump $::imagedir/${::casename}_clip2_selection_top.png
vaxo
verase pp2
vmoveto 75 200
vdump $::imagedir/${::casename}_clip2_no_selection.png
vtop
vmoveto 250 200
vdump $::imagedir/${::casename}_clip2_no_selection_top.png
vaxo
vfit
vclipplane pl1 -delete
vclipplane pl2 -delete
vmoveto 200 200