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