0026855: Draw commands to debug Boolean Operations Algorithm
[occt.git] / tests / bugs / xde / bug9531
1 puts "TODO OCC12345 ALL: Error :  is WRONG because number of "
2 puts "TODO OCC12345 ALL: OCC9531: Faulty"
3
4 puts "============"
5 puts "OCC9531"
6 puts "============"
7 puts ""
8 #######################################################################
9 # Regression after writing-reading operation
10 #######################################################################
11
12 set BugNumber OCC9531
13
14 set IsOk 1
15 set filepath [locate_data_file 919-001-T02-04-CP-VL.igs]
16 if {[catch {igesread $filepath OCC9531a *}]} {
17    puts "Faulty ${BugNumber} : here is reading problem"
18    set IsOk 0
19 }
20
21 file delete ${imagedir}/OCC9531tmp.igs
22
23 if {[catch {brepiges OCC9531a ${imagedir}/OCC9531tmp.igs}]} {
24    puts "Faulty ${BugNumber} : here is conversation to brep problem"
25    set IsOk 0
26 }
27 catch {exec chmod 777 ${imagedir}/OCC9531tmp.igs}
28
29 if {[catch {igesread ${imagedir}/OCC9531tmp.igs OCC9531b *}]} {
30    puts "Faulty ${BugNumber} : here is 2nd reading problem"
31    set IsOk 0
32 }
33
34 if { ${IsOk} == 1} {
35    set aTokList {= }
36    set Tol1 [lindex [split [tolerance OCC9531a] ${aTokList}] 2]
37    set Tol2 [lindex [split [tolerance OCC9531b] ${aTokList}] 2]
38    set percent_max 0.1
39    set Tolerance_percent [GetPercent ${Tol1} ${Tol2}]
40    puts "Tolerance_percent = ${Tolerance_percent} %"
41    if { ${Tolerance_percent}  > ${percent_max} } {
42       set IsOk 0
43    }
44
45    set good_square 5236.89
46
47    checknbshapes OCC9531a -vertex 5748 -edge 5680 -wire 915 -face 899 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 13243
48
49    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531a] full sq1
50
51    if {$sq1 != $good_square} {
52          set IsOk 0
53    }    
54
55    checknbshapes OCC9531b -vertex 5748 -edge 5680 -wire 915 -face 899 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 13243
56
57    regexp {Mass +: +([-0-9.+eE]+)} [sprops OCC9531b] full sq2
58    if {$sq2 != $good_square} {
59          set IsOk 0
60    }    
61
62    if { ${IsOk}  == 0 } {
63       puts "${BugNumber}: Faulty"
64    } else {
65       puts "${BugNumber}: OK"
66    }
67 }
68
69 renamevar OCC9531b result
70 set 2dviewer 0