1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-05 11:24:17 +03:00
occt/tests/bugs/vis/bug31412
mzernova 2ff1d580f1 0031412: Visualization - entity behind is returned as topmost at the edges
SelectMgr_RectangularFrustum now handles degenerated triangle as a segment or a point.
Triangle orthogonal to view direction is now handled as a segment.
myViewRayDir field is now defined as normalized vector to avoid confusing math.

For the case when the segment and myViewRayDir are almost parallel,
the segmentSegmentDistance function may set the depth to zero, although this will not
be the correct value, therefore it is better to pass a segment that will not
be parallel to myViewRayDir as an argument to the function.

vpoint command has been extended by arguments -2d and -nosel
for displaying picking mouse position as on-screen point in pixels.
Fixed double-binding-map error in case of displaying point with already used name.

bugs/vis/bug31412: test case added.
2020-06-25 19:09:04 +03:00

36 lines
981 B
Plaintext

puts "============="
puts "0031412: Visualization - entity behind is returned as topmost at the edges"
puts "============="
pload VISUALIZATION
box b1 250 250 900 1000 1000 200
box b2 1000 1000 1000
vdisplay -dispMode 1 b1 b2
vaspects b1 -setWidth 3 -setColor ORANGE
vaspects b2 -setWidth 3 -setColor MATRABLUE
vrenderparams -shadingModel UNLIT
vviewparams -proj 0 0 1
vfit
vmoveto 325 100
if { [vreadpixel 325 400 rgb name] == "CYAN" } { puts "ERROR: back box is misdetected" }
vpoint p1 -2d -nosel 325 100
vdump $imagedir/${casename}_proj_Z.png
vremove p1
vviewparams -proj 0 1 0
vfit
vmoveto 200 58
if { [vreadpixel 400 58 rgb name] == "CYAN" } { puts "ERROR: back box is misdetected" }
vpoint p2 -2d -nosel 200 58
vdump $imagedir/${casename}_proj_Y.png
vremove p2
vviewparams -proj 1 0 0
vfit
vmoveto 200 58
if { [vreadpixel 50 58 rgb name] == "CYAN" } { puts "ERROR: back box is misdetected" }
vpoint p3 -2d -nosel 200 58
vdump $imagedir/${casename}_proj_X.png
vremove p3