02effd35 |
1 | puts "================" |
2 | puts "OCC25292" |
3 | puts "================" |
4 | puts "" |
5 | ####################################################################### |
6 | # Face/Face intersection algorithm gives different results for different order of the arguments |
7 | ####################################################################### |
8 | |
e8feb725 |
9 | proc GetRange { curve } { |
10 | global U1 |
11 | global U2 |
12 | |
13 | set log [uplevel dump $curve] |
14 | |
15 | regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles |
16 | puts "Degree=${Degree}" |
17 | puts "Poles=${Poles}" |
18 | puts "KnotsPoles=${KnotsPoles}" |
19 | puts "" |
20 | |
21 | set Knot 1 |
22 | set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" |
23 | regexp ${exp_string} ${log} full U1 Mult1 |
24 | |
25 | set Knot ${KnotsPoles} |
26 | set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)" |
27 | regexp ${exp_string} ${log} full U2 Mult2 |
28 | } |
29 | |
30 | puts "##############################" |
31 | puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" |
32 | puts "##############################" |
33 | puts "" |
34 | |
02effd35 |
35 | # intersect command |
36 | |
e8feb725 |
37 | #This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. |
38 | set GoodNbCurv 4 |
39 | |
02effd35 |
40 | restore [locate_data_file bug25292_Input_0.brep] b1 |
41 | restore [locate_data_file bug25292_Input_1.brep] b2 |
42 | |
43 | explode b1 f |
44 | copy b1_2 f1 |
45 | explode b2 f |
46 | copy b2_2 f2 |
47 | |
48 | mksurface s1 f1 |
49 | mksurface s2 f2 |
50 | |
51 | ################# |
e8feb725 |
52 | intersect res s2 s1 |
02effd35 |
53 | ################# |
54 | |
e8feb725 |
55 | set che [whatis res] |
56 | set ind [string first "3d curve" $che] |
57 | if {${ind} >= 0} { |
58 | #Only variable "res" exists |
59 | |
60 | if { $GoodNbCurv == 1 } { |
61 | puts "OK: Curve Number is good!" |
62 | } else { |
63 | puts "Error: Curve Number is bad!" |
64 | } |
65 | |
66 | set U1 0.0 |
67 | set U2 0.0 |
68 | |
69 | GetRange res |
70 | |
71 | puts "U1 = ${U1}" |
72 | puts "U2 = ${U2}" |
73 | |
74 | if {[expr {$U2 - $U1}] < 1.0e-20} { |
75 | puts "Error: Wrong curve's range!" |
76 | } |
77 | |
78 | dlog reset |
79 | dlog on |
80 | xdistcs res s1 ${U1} ${U2} 10 |
81 | set Log1 [dlog get] |
82 | set List1 [split ${Log1} {TD= \t\n}] |
7c32c7c4 |
83 | set Tolerance 1.0e-7 |
e8feb725 |
84 | set Limit_Tol 1.0e-7 |
85 | set D_good 0. |
86 | checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} |
87 | |
88 | dlog reset |
89 | dlog on |
90 | xdistcs res s2 ${U1} ${U2} 10 |
91 | set Log1 [dlog get] |
92 | set List1 [split ${Log1} {TD= \t\n}] |
7c32c7c4 |
93 | set Tolerance 1.0e-7 |
e8feb725 |
94 | set Limit_Tol 1.0e-7 |
95 | set D_good 0. |
96 | checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} |
02effd35 |
97 | } else { |
e8feb725 |
98 | set ic 1 |
99 | set AllowRepeate 1 |
100 | while { $AllowRepeate != 0 } { |
101 | set che [whatis res_$ic] |
102 | set ind [string first "3d curve" $che] |
103 | if {${ind} < 0} { |
104 | set AllowRepeate 0 |
105 | } else { |
106 | set U1 0.0 |
107 | set U2 0.0 |
108 | |
109 | GetRange res_$ic |
110 | |
111 | puts "U1 = ${U1}" |
112 | puts "U2 = ${U2}" |
113 | |
114 | if {[expr {$U2 - $U1}] < 1.0e-20} { |
115 | puts "Error: Wrong curve's range!" |
116 | } |
117 | |
118 | dlog reset |
119 | dlog on |
120 | xdistcs res_$ic s1 ${U1} ${U2} 10 |
121 | set Log1 [dlog get] |
122 | set List1 [split ${Log1} {TD= \t\n}] |
7c32c7c4 |
123 | set Tolerance 1.0e-7 |
e8feb725 |
124 | set Limit_Tol 1.0e-7 |
125 | set D_good 0. |
126 | checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} |
127 | |
128 | dlog reset |
129 | dlog on |
130 | xdistcs res_$ic s2 0 1 10 |
131 | set Log1 [dlog get] |
132 | set List1 [split ${Log1} {TD= \t\n}] |
7c32c7c4 |
133 | set Tolerance 1.0e-7 |
e8feb725 |
134 | set Limit_Tol 1.0e-7 |
135 | set D_good 0. |
136 | checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} |
137 | |
138 | incr ic |
139 | } |
140 | } |
141 | |
142 | if {[expr {$ic - 1}] == $GoodNbCurv} { |
143 | puts "OK: Curve Number is good!" |
144 | } else { |
145 | puts "Error: Curve Number is bad!" |
146 | } |
02effd35 |
147 | } |