0026235: Command tolmax works wrong
[occt.git] / tests / bugs / moddata_2 / bug343
CommitLineData
a87752f3 1puts "================"
2puts "BUC61039"
3puts "OCC343"
4puts "================"
5puts ""
6
7cpulimit 9000
8pload XDE
5d1833ef 9
10set filepath [locate_data_file lh3d_px1.igs]
11if [catch {igesbrep $filepath a *} catch_result] {
a87752f3 12 puts "Faulty OCC343: here is reading problem"
13} else {
14 puts "Reading OCC343 OK"
15 tpcompound a
16 #
17 # First sewing
18 #
19 sewing result1 100. a
20
fb60057d 21 checkmaxtol result1 -ref 9.43897e+001
5ae01c85 22 checknbshapes result1 -shell 1
23 checkfreebounds result1 86
24
a87752f3 25 set FaceList [explode result1 f]
26 set FaceListLength [llength ${FaceList}]
27 if { ${FaceListLength} < 1 } {
28 puts "OCC343 - Error : FaceListLength= ${FaceListLength}"
29 }
30
31 set X_List1 [list]
32 set Y_List1 [list]
33 set Z_List1 [list]
34 for {set i 1} {${i} <= ${FaceListLength}} {incr i} {
35 set props [sprops result1_${i}]
36 set list [split ${props} "\n\t"]
37 set listLength [llength ${list}]
38 if { ${listLength} < 20 } {
39 puts "OCC343 - Error : listLength= ${listLength}"
40 }
41 set Center_Gravity_X [lindex ${list} 5]
42 set Center_Gravity_Y [lindex ${list} 6]
43 set Center_Gravity_Z [lindex ${list} 7]
44
45 set Center_Gravity_X [lindex [split ${Center_Gravity_X}] [expr [llength [split ${Center_Gravity_X}] ] - 1] ]
46 set Center_Gravity_Y [lindex [split ${Center_Gravity_Y}] [expr [llength [split ${Center_Gravity_Y}] ] - 1] ]
47 set Center_Gravity_Z [lindex [split ${Center_Gravity_Z}] [expr [llength [split ${Center_Gravity_Z}] ] - 1] ]
48
49 lappend X_List1 ${Center_Gravity_X}
50 lappend Y_List1 ${Center_Gravity_Y}
51 lappend Z_List1 ${Center_Gravity_Z}
52 }
53
54 vinit
55 vdisplay result1
56 vfit
57
58 set CycleNumber 10
59 for {set j 1} {${j} <= ${CycleNumber}} {incr j} {
60 veraseall
61 #
62 # Second sewing
63 #
64
5d1833ef 65 if [catch {igesbrep $filepath a *} catch_result] {
a87752f3 66 puts "Faulty OCC343: here is reading problem"
67 } else {
68 puts "Reading OCC343 OK"
69 }
70
71 tpcompound a
72 sewing result2 100. a
73
fb60057d 74 checkmaxtol result2 -ref 9.43897e+001
5ae01c85 75 checknbshapes result2 -shell 1
76 checkfreebounds result2 86
77
a87752f3 78 set FaceList [explode result2 f]
79 set FaceListLength [llength ${FaceList}]
80 if { ${FaceListLength} < 1 } then {puts "OCC343 - Error : FaceListLength= ${FaceListLength}"}
81
82 set X_List2 [list]
83 set Y_List2 [list]
84 set Z_List2 [list]
85 for {set i 1} {${i} <= ${FaceListLength}} {incr i} {
86 set props [sprops result2_${i}]
87 set list [split ${props} "\n\t"]
88 set listLength [llength ${list}]
89 if { ${listLength} < 20 } {
90 puts "OCC343 - Error : listLength= ${listLength}"
91 }
92
93 set Center_Gravity_X [lindex ${list} 5]
94 set Center_Gravity_Y [lindex ${list} 6]
95 set Center_Gravity_Z [lindex ${list} 7]
96
97 set Center_Gravity_X [lindex [split ${Center_Gravity_X}] [expr [llength [split ${Center_Gravity_X}] ] - 1] ]
98 set Center_Gravity_Y [lindex [split ${Center_Gravity_Y}] [expr [llength [split ${Center_Gravity_Y}] ] - 1] ]
99 set Center_Gravity_Z [lindex [split ${Center_Gravity_Z}] [expr [llength [split ${Center_Gravity_Z}] ] - 1] ]
100
101 lappend X_List2 ${Center_Gravity_X}
102 lappend Y_List2 ${Center_Gravity_Y}
103 lappend Z_List2 ${Center_Gravity_Z}
104 }
105
106 set ListLength [llength ${X_List1}]
107 if { ${ListLength} != [llength ${Y_List1}] } then {puts "OCC343 - Error : ListLength= ${ListLength}"}
108 if { ${ListLength} != [llength ${Z_List1}] } then {puts "OCC343 - Error : ListLength= ${ListLength}"}
109 if { ${ListLength} != [llength ${X_List2}] } then {puts "OCC343 - Error : ListLength= ${ListLength}"}
110 if { ${ListLength} != [llength ${Y_List2}] } then {puts "OCC343 - Error : ListLength= ${ListLength}"}
111 if { ${ListLength} != [llength ${Z_List2}] } then {puts "OCC343 - Error : ListLength= ${ListLength}"}
112
113 for {set i 0} {${i} < ${ListLength}} {incr i} {
114 set X1 [lindex ${X_List1} ${i}]
115 set X2 [lindex ${X_List2} ${i}]
116 if { ${X1} != ${X2} } {
117 puts "OCC343 - Error : X1= ${X1} X2= ${X2}"
118 }
119 set Y1 [lindex ${Y_List1} ${i}]
120 set Y2 [lindex ${Y_List2} ${i}]
121 if { ${Y1} != ${Y2} } {
122 puts "OCC343 - Error : Y1= ${Y1} Y2= ${Y2}"
123 }
124 set Z1 [lindex ${Z_List1} ${i}]
125 set Z2 [lindex ${Z_List2} ${i}]
126 if { ${Z1} != ${Z2} } {
127 puts "OCC343 - Error : Z1= ${Z1} Z2= ${Z2}"
128 }
129 }
130
131 tclean result1
132 vdisplay result1
133 vfit
134 }
135}
136
137set only_screen 1
138
139
140
141