0026742: Update test cases for using checknbshapes procedure instead of global variables
[occt.git] / tests / bugs / modalg_4 / bug6334
1 puts "============"
2 puts "OCC6334"
3 puts "============"
4 puts ""
5 ######################################################
6 # Invalid result of MakeCylindricalHole when input solid is REVERSED
7 ######################################################
8
9 set BugNumber OCC6334
10
11 # 1. Make box
12 box b 100 100 100
13
14 subshape b f 1
15 offsetshape t b 10 b_1
16
17 decho off
18 set che_t [checkshape t]
19 decho on
20
21 if {[regexp {Faulty} $che_t]} {
22     puts "Faulty ${BugNumber} : checkshape is wrong for t"
23 }
24
25 set bnd_t [bounding t]
26 set ori [lindex [dtyp t] 2]
27 puts "Orientation of thick solid is $ori"
28
29 # 3. Make hole
30 hole h t 110 50 50 1 0 0 10
31
32 set che [checkshape h]
33 if { [regexp {Faulty} $che] } {
34     puts "Faulty ${BugNumber} : checkshape is wrong for h"
35 }
36
37 set bnd_h [bounding h]
38
39 renamevar h result
40
41 set square 117509
42
43 checknbshapes result -vertex 30 -edge 51 -wire 27 -face 24 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 135
44
45 # 4. Check thickness of box and hole
46 set dx_t [expr [lindex $bnd_t 3] - [lindex $bnd_t 0]]
47 set dx_h [expr [lindex $bnd_h 3] - [lindex $bnd_h 0]]
48
49 if { [expr abs($dx_h - $dx_t)] > 1e-5 } {
50   puts "Thickness of solid = $dx_t"
51   puts "Thickness of solid with hole = $dx_h"
52   puts "Invalid result of making a hole"
53   puts "Faulty ${BugNumber}"
54 } else {
55   puts "OK ${BugNumber}"
56 }
57
58 set 2dviewer 0