File: bug25292_25

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (148 lines) | stat: -rw-r--r-- 3,497 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
puts "================"
puts "OCC25292"
puts "================"
puts ""
#######################################################################
# Face/Face intersection algorithm gives different results for different order of the arguments
#######################################################################

proc GetRange { curve } {
  global U1
  global U2
  
  set log [uplevel dump $curve]
  
  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
  puts "Degree=${Degree}"
  puts "Poles=${Poles}"
  puts "KnotsPoles=${KnotsPoles}"
  puts ""

  set Knot 1
  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
  regexp ${exp_string} ${log} full U1 Mult1

  set Knot ${KnotsPoles}
  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
  regexp ${exp_string} ${log} full U2 Mult2
}

puts "##############################"
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
puts "##############################"
puts ""

# intersect command

#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
set GoodNbCurv 2

restore [locate_data_file bug25292_Input_3.brep] b1
restore [locate_data_file bug25292_Input_11.brep] b2

explode b1 f
copy b1_1 f1
explode b2 f
copy b2_1 f2

mksurface s1 f1
mksurface s2 f2

#################
intersect res s1 s2
#################

set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
  #Only variable "res" exists
  
  if { $GoodNbCurv == 1 } {
    puts "OK: Curve Number is good!"
  } else {
    puts "Error: Curve Number is bad!"
  }
  
  set U1 0.0
  set U2 0.0
  
  GetRange res

  puts "U1 = ${U1}"
  puts "U2 = ${U2}"

  if {[expr {$U2 - $U1}] < 1.0e-20} {
    puts "Error: Wrong curve's range!"
  }
  
  dlog reset
  dlog on
  xdistcs res s1 ${U1} ${U2} 10
  set Log1 [dlog get]
  set List1 [split ${Log1} {TD= \t\n}]
  set Tolerance 1.0e-7
  set Limit_Tol 1.0e-7
  set D_good 0.
  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
  
  dlog reset
  dlog on
  xdistcs res s2 ${U1} ${U2} 10
  set Log1 [dlog get]
  set List1 [split ${Log1} {TD= \t\n}]
  set Tolerance 1.0e-7
  set Limit_Tol 1.0e-7
  set D_good 0.
  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
} else {
  set ic 1
  set AllowRepeate 1
  while { $AllowRepeate != 0 } {
    set che [whatis res_$ic]
    set ind [string first "3d curve" $che]
    if {${ind} < 0} {
      set AllowRepeate 0
    } else {
      set U1 0.0
      set U2 0.0
      
      GetRange res_$ic
      
      puts "U1 = ${U1}"
      puts "U2 = ${U2}"
      
      if {[expr {$U2 - $U1}] < 1.0e-20} {
        puts "Error: Wrong curve's range!"
      }
      
      dlog reset
      dlog on
      xdistcs res_$ic s1 ${U1} ${U2} 10
      set Log1 [dlog get]
      set List1 [split ${Log1} {TD= \t\n}]
      set Tolerance 1.0e-7
      set Limit_Tol 1.0e-7
      set D_good 0.
      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
      
      dlog reset
      dlog on
      xdistcs res_$ic s2 0 1 10
      set Log1 [dlog get]
      set List1 [split ${Log1} {TD= \t\n}]
      set Tolerance 1.0e-7
      set Limit_Tol 1.0e-7
      set D_good 0.
      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
      
      incr ic
    }
  }
  
  if {[expr {$ic - 1}] == $GoodNbCurv} {
    puts "OK: Curve Number is good!"
  } else {
    puts "Error: Curve Number is bad!"
  }
}