0026855: Draw commands to debug Boolean Operations Algorithm
[occt.git] / tests / bugs / modalg_5 / bug25292_21
CommitLineData
02effd35 1puts "================"
2puts "OCC25292"
3puts "================"
4puts ""
5#######################################################################
6# Face/Face intersection algorithm gives different results for different order of the arguments
7#######################################################################
8
e8feb725 9puts "##############################"
10puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
11puts "##############################"
12puts ""
13puts ""
14
02effd35 15# bopcurves command
16
17restore [locate_data_file bug25292_Input_3.brep] b1
18restore [locate_data_file bug25292_Input_11.brep] b2
19
20explode b1 f
21copy b1_1 f1
22explode b2 f
23copy b2_1 f2
24
25#########################
e8feb725 26set log [bopcurves f1 f2 -2d]
02effd35 27#########################
28
29regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
e8feb725 30
31#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid.
02effd35 32set MaxTol 1.e-7
e8feb725 33
34#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid.
35set GoodNbCurv 2
36
02effd35 37if {${Toler} > ${MaxTol}} {
38 puts "Error: Tolerance is too big!"
39}
e8feb725 40
02effd35 41if {${NbCurv} != ${GoodNbCurv}} {
42 puts "Error: Curve Number is bad!"
43}
44
45#-------------
46
02effd35 47mksurface s1 f1
48mksurface s2 f2
49
e8feb725 50for {set i 1} {$i <= ${NbCurv}} {incr i} {
51 set log [dump c_$i]
52
53 regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
54 puts "Degree=${Degree}"
55 puts "Poles=${Poles}"
56 puts "KnotsPoles=${KnotsPoles}"
57 puts ""
58
59 set Knot 1
60 set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
61 regexp ${exp_string} ${log} full U1 Mult1
62
63 set Knot ${KnotsPoles}
64 set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
65 regexp ${exp_string} ${log} full U2 Mult2
66
67 puts "U1=${U1}"
68 puts "U2=${U2}"
69
70 if {[expr {$U2 - $U1}] < 1.0e-20} {
71 puts "Error: Wrong curve's range!"
72 }
73
6d368502 74 xdistcs c_$i s1 ${U1} ${U2} 10 1e-7
75 xdistcs c_$i s2 ${U1} ${U2} 10 1e-7
e8feb725 76}
02effd35 77
78smallview
79fit
80set only_screen_axo 1