0025124: [Feature request] Removal of continuity checks for offset geometries
[occt.git] / tests / bugs / modalg_5 / bug25292_26
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
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
35 # intersect command
36
37 #This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
38 set GoodNbCurv 2
39
40 restore [locate_data_file bug25292_Input_3.brep] b1
41 restore [locate_data_file bug25292_Input_11.brep] b2
42
43 explode b1 f
44 copy b1_1 f1
45 explode b2 f
46 copy b2_1 f2
47
48 mksurface s1 f1
49 mksurface s2 f2
50
51 #################
52 intersect res s2 s1
53 #################
54
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}]
83   set Tolerance 1.1e-7
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}]
93   set Tolerance 1.1e-7
94   set Limit_Tol 1.0e-7
95   set D_good 0.
96   checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
97 } else {
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}]
123       set Tolerance 1.1e-7
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}]
133       set Tolerance 1.1e-7
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   }
147 }