0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL
[occt.git] / tests / bugs / modalg_5 / bug25292_33
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 puts "##############################"
10 puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
11 puts "##############################"
12 puts ""
13
14 # intersect command
15
16 #This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid. 
17 set GoodNbCurv 1
18
19 restore [locate_data_file bug25292_f1.brep] f1
20 restore [locate_data_file bug25292_f2.brep] f2
21
22 mksurface s1 f1
23 mksurface s2 f2
24
25 #################
26 intersect res s1 s2
27 #################
28
29 set che [whatis res]
30 set ind [string first "3d curve" $che]
31 if {${ind} >= 0} {
32   #Only variable "res" exists
33   renamevar res res_1
34 }
35
36 set ic 1
37 set AllowRepeate 1
38 while { $AllowRepeate != 0 } {
39   set che [whatis res_$ic]
40   set ind [string first "3d curve" $che]
41   if {${ind} < 0} {
42     set AllowRepeate 0
43   } else {
44     display res_$ic
45     
46     bounds res_$ic U1 U2
47     
48     dval U1
49     dval U2
50     
51     if {[dval U2-U1] < 1.0e-20} {
52       puts "Error: Wrong curve's range!"
53     }
54     
55     xdistcs res_$ic s1 U1 U2 10 1.0e-7
56     xdistcs res_$ic s2 U1 U2 10 1.0e-7
57     
58     incr ic
59   }
60 }
61
62 if {[expr {$ic - 1}] == $GoodNbCurv} {
63   puts "OK: Curve Number is good!"
64 } else {
65   puts "Error: Curve Number is bad!"
66 }