mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0026304: Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint
This commit is contained in:
parent
5050c82886
commit
026dbb46c9
@ -776,7 +776,7 @@ Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt&
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
SelectMgr_Vec3 SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real theDepth) const
|
SelectMgr_Vec3 SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real theDepth) const
|
||||||
{
|
{
|
||||||
return myNearPickedPnt + myViewRayDir * theDepth;
|
return myNearPickedPnt + myViewRayDir.Normalized() * theDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
46
tests/bugs/vis/bug26304
Normal file
46
tests/bugs/vis/bug26304
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR26304"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
puts "Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint"
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
proc findPoint {theInfoString} {
|
||||||
|
puts $theInfoString
|
||||||
|
set aStringArr [split $theInfoString " "]
|
||||||
|
set aSize [llength $aStringArr]
|
||||||
|
for {set aIdx 0} {$aIdx < $aSize} {incr aIdx} {
|
||||||
|
set aItem [lindex $theInfoString $aIdx]
|
||||||
|
if {[string compare $aItem "Point:"] == 0} {
|
||||||
|
set aX [string trim [lindex $theInfoString [expr $aIdx + 1]]]
|
||||||
|
set aY [string trim [lindex $theInfoString [expr $aIdx + 2]]]
|
||||||
|
set aZ [string trim [lindex $theInfoString [expr $aIdx + 3]]]
|
||||||
|
return [list $aX $aY $aZ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pload VISUALIZATION MODELING
|
||||||
|
|
||||||
|
vinit View1
|
||||||
|
vsetdispmode 1
|
||||||
|
box b 100 100 100
|
||||||
|
vdisplay b
|
||||||
|
vfit
|
||||||
|
vselect 48 258
|
||||||
|
|
||||||
|
set anOut [split [vstate -entities] "\n"]
|
||||||
|
set aPnt [findPoint [lindex $anOut 1]]
|
||||||
|
vpoint p {*}$aPnt
|
||||||
|
vfit
|
||||||
|
|
||||||
|
vviewparams -scale 22.3 -proj 0.576 -0.78 0.24 -up -0.21 0.136 0.967
|
||||||
|
vviewparams -at 10.887 16.807 36.2306 -eye 111.071 -118.34 77.44
|
||||||
|
|
||||||
|
if {[vreadpixel 103 293 name] != "YELLOW 1"} {
|
||||||
|
puts "ERROR: Wrong point calculated"
|
||||||
|
}
|
||||||
|
|
||||||
|
vdump ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user