0026342: No materials are read from STEP
[occt.git] / tests / bugs / vis / bug25760_1
CommitLineData
ea764884 1puts "============"
2puts "CR25760"
3puts "============"
4puts ""
5#######################################################################
6# Visualization - precision factor added to ZNear, ZFar in method ZFitAll() of Graphic3d_Camera is not enough
7#######################################################################
8
9vinit View1 w=409 h=409
10vclear
11
12proc test2d {} {
13 set pix1 {135 204}
14 set pix2 {204 187}
15
16 for {set i 8} {$i <= 8} {incr i} {
17 set min_z [expr pow (-10, $i)]
18 set max_z [expr $min_z + 1000]
19 plane p1 0 0 $min_z 0 0 1
20 plane p2 0 0 $max_z 0 0 1
21
22 mkface f1 p1 -1 0 -1 0
23 mkface f2 p2 0 1 0 1
24
25 vclear
26 vdisplay f1 f2
27 vtop
28 vfit
29
30 for {set z [expr $max_z + 1.0]} {$z <= 1e10} {set z [expr abs ($z) * 1.2]} {
31 vviewparams -eye 0 0 $z
32 vmoveto {*}$pix1
33 if { [checkcolor {*}$pix1 0 1 1] != 1 } {
34 puts "Error: 2D projection test failed with the following parameters:"
35 vviewparams
36 vzrange
37 puts ""
38 puts "z : $z"
39 puts "min_z: $min_z"
40 puts "max_z: $max_z"
41 return 0
42 }
43 vmoveto {*}$pix2
44 if { [checkcolor {*}$pix2 0 1 1] != 1 } {
45 puts "Error: 2D projection test failed with the following parameters:"
46 vviewparams
47 vzrange
48 puts ""
49 puts "z : $z"
50 puts "min_z: $min_z"
51 puts "max_z: $max_z"
52 return 0
53 }
54 }
55 }
56 return 1
57}
58
59set tcl_precision 16
60
61####################################################################
62# Test orthographic camera without frustum culling. #
63####################################################################
64vcamera -ortho
65vfrustumculling 0
66
67if { [test2d] != 1 } {
68 puts "Error: 2D projection test failed: view frustum culling is OFF"
69}
70
71####################################################################
72# Test orthographic camera with frustum culling. #
73####################################################################
74vcamera -ortho
75vfrustumculling 1
76
77if { [test2d] != 1 } {
78 puts "Error: 2D projection test failed: view frustum culling is ON"
79}