0026342: No materials are read from STEP
[occt.git] / tests / bugs / modalg_5 / bug25416_2
CommitLineData
d4b867e6 1puts "================"
2puts "OCC25416"
3puts "================"
4puts ""
5#######################################################################
6# Wrong section curve
7#######################################################################
8
9# Check if list of xdistcs-command is valid
10proc checkList {List Tolerance D_good Limit_Tol} {
11 set L1 [llength ${List}]
12 set L2 10
13 set L3 5
14 set N [expr (${L1} - ${L2})/${L3} + 1]
15
16 for {set i 1} {${i} <= ${N}} {incr i} {
17 set j1 [expr ${L2} + (${i}-1)*${L3}]
18 set j2 [expr ${j1} + 2]
19 set T [lindex ${List} ${j1}]
20 set D [lindex ${List} ${j2}]
21 #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
22 if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
23 puts "Error: T=${T} D=${D}"
24 }
25
26 if { ${Tolerance} > ${Limit_Tol} } {
27 if { [expr abs(${D} - ${D_good})] > ${Limit_Tol}
28 && [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
29 puts "Attention (critical value of tolerance) : T=${T} D=${D}"
30 }
31 }
32 }
33}
34
35puts "##############################"
36puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
37puts "##############################"
38puts ""
39puts ""
40
41# bopcurves command
42
43restore [locate_data_file bug25416_f3.brep] f1
44restore [locate_data_file bug25416_f4.brep] f2
45
46mksurface s1 f1
47mksurface s2 f2
48
49#Trim according to "xbounds f1"
50trim s1 s1 -55.44 150.554 -98.1087 79.1766
51
52mkface ff1 s1
53donly ff1 f2
54
55#############################
56set log [bopcurves ff1 f2]
57#############################
58
59regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
60
61#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
62set MaxTol 1.e-7
63
64#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
65set GoodNbCurv 2
66
67if {${Toler} > ${MaxTol}} {
68 puts "Error: Tolerance is too big!"
69}
70if {${NbCurv} != ${GoodNbCurv}} {
71 puts "Error: Curve Number is bad!"
72}
73
74#-------------
75
76for {set i 1} {$i <= ${NbCurv}} {incr i} {
77 set log [dump c_$i]
78 set dumptrimres [regexp {Trimmed curve\nParameters : +([-0-9.+eE]+) +([-0-9.+eE]+)} ${log} full U1 U2]
79
80 if {${dumptrimres} == 0} {
81 regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
82
83 puts "Degree=${Degree}"
84 puts "Poles=${Poles}"
85 puts "KnotsPoles=${KnotsPoles}"
86 puts ""
87
88 set Knot 1
89 set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
90 regexp ${exp_string} ${log} full U1 Mult1
91
92 set Knot ${KnotsPoles}
93 set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
94 regexp ${exp_string} ${log} full U2 Mult2
95 }
96
97 puts "U1=${U1}"
98 puts "U2=${U2}"
99
100 if {[expr {$U2 - $U1}] < 1.0e-20} {
101 puts "Error: Wrong curve's range!"
102 }
103
104 dlog reset
105 dlog on
106 xdistcs c_$i s1 ${U1} ${U2} 10
107 set Log2 [dlog get]
108 set List2 [split ${Log2} {TD= \t\n}]
109 set Tolerance 1.0e-7
110 set Limit_Tol 1.0e-7
111 set D_good 0.
112 checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
113
114 dlog reset
115 dlog on
116 xdistcs c_$i s2 ${U1} ${U2} 10
117 set Log2 [dlog get]
118 set List2 [split ${Log2} {TD= \t\n}]
119 set Tolerance 1.0e-7
120 set Limit_Tol 1.0e-7
121 set D_good 0.
122 checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
123}
124
125smallview
126fit
127set only_screen_axo 1