Prepared branch for raising to master
[occt.git] / tests / bugs / xde / bug9531
1 puts "TODO OCC12345 ALL: OCC9531: Faulty"
2
3 puts "============"
4 puts "OCC9531"
5 puts "============"
6 puts ""
7 #######################################################################
8 # Regression after writing-reading operation
9 #######################################################################
10
11 set BugNumber OCC9531
12
13 set IsOk 1
14 if {[catch {igesread [locate_data_file 919-001-T02-04-CP-VL.igs] OCC9531a *}]} {
15    puts "Faulty ${BugNumber} : here is reading problem"
16    set IsOk 0
17 }
18
19 file delete ${imagedir}/OCC9531tmp.igs
20
21 if {[catch {brepiges OCC9531a ${imagedir}/OCC9531tmp.igs}]} {
22    puts "Faulty ${BugNumber} : here is conversation to brep problem"
23    set IsOk 0
24 }
25 catch {exec chmod 777 ${imagedir}/OCC9531tmp.igs}
26
27 if {[catch {igesread ${imagedir}/OCC9531tmp.igs OCC9531b *}]} {
28    puts "Faulty ${BugNumber} : here is 2nd reading problem"
29    set IsOk 0
30 }
31
32 if { ${IsOk} == 1} {
33    set aTokList {= }
34    set Tol1 [lindex [split [tolerance OCC9531a] ${aTokList}] 2]
35    set Tol2 [lindex [split [tolerance OCC9531b] ${aTokList}] 2]
36    set percent_max 0.1
37    set Tolerance_percent [GetPercent ${Tol1} ${Tol2}]
38    puts "Tolerance_percent = ${Tolerance_percent} %"
39    if { ${Tolerance_percent}  > ${percent_max} } {
40       set IsOk 0
41    }
42
43    set good_square 5236.89
44    set good_vertex 5748
45    set good_edge 5680
46    set good_wire 915
47    set good_face 899
48    set good_shell 0
49    set good_solid 0
50    set good_compsolid 0
51    set good_compound 1
52    set good_shape 13243
53
54    set nb_info [nbshapes OCC9531a]
55    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531a] full sq1
56    regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v1
57    regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e1
58    regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w1
59    regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f1
60    regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh1
61    regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol1
62    regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol1
63    regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound1
64    regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape1
65    if {$sq1 != $good_square
66       || $nb_v1 != $good_vertex
67       || $nb_e1 != $good_edge
68       || $nb_w1 != $good_wire
69       || $nb_f1 != $good_face
70       || $nb_sh1 != $good_shell
71       || $nb_sol1 != $good_solid
72       || $nb_compsol1 != $good_compsolid
73       || $compound1 != $good_compound
74       || $nb_shape1 != $good_shape } {
75          set IsOk 0
76    }    
77
78    set nb_info [nbshapes OCC9531b]
79    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531b] full sq2
80    regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v2
81    regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e2
82    regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w2
83    regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f2
84    regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh2
85    regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol2
86    regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol2
87    regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound2
88    regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape2
89    if {$sq2 != $good_square
90       || $nb_v2 != $good_vertex
91       || $nb_e2 != $good_edge
92       || $nb_w2 != $good_wire
93       || $nb_f2 != $good_face
94       || $nb_sh2 != $good_shell
95       || $nb_sol2 != $good_solid
96       || $nb_compsol2 != $good_compsolid
97       || $compound2 != $good_compound
98       || $nb_shape2 != $good_shape } {
99          set IsOk 0
100    }    
101
102    if { ${IsOk}  == 0 } {
103       puts "${BugNumber}: Faulty"
104    } else {
105       puts "${BugNumber}: OK"
106    }
107 }
108
109 renamevar OCC9531b result
110 set 2dviewer 0