File: bug25782_1

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 (104 lines) | stat: -rw-r--r-- 2,282 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
puts "========"
puts "OCC25782"
puts "========"
puts ""
######################################################
# The result of intersection between two cylinders is incorrect
# Algorithm must find one curves only
######################################################

set GoodNbCurv 1

restore [locate_data_file bug25782_fz19.brep] b1
restore [locate_data_file bug25782_fz53.brep] b2

mksurface s1 b1
mksurface s2 b2

intersect res s1 s2

set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
  #Only variable "res" exists
  
  copy res res_1
}

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 {
    dlog reset
    dlog on
    xdistcs res_$ic s1 0 100 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 100 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: Curves Number is bad!"
}

set log [bopcurves b1 b2]

regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
set MaxTol 1.e-7
if {${Toler} > ${MaxTol}} {
   puts "Error: Tolerance is too big!"
}

if {$NbCurv != $GoodNbCurv} {
  puts "Error: Curves Number is bad!"
}

for {set i 1} {$i <= ${NbCurv}} {incr i} {
  bounds c_$i U1 U2
  
  if {[dval U2-U1] < 1.0e-9} {
    puts "Error: Wrong curve's range!"
  }

  dlog reset
  dlog on
  xdistcs c_$i s1 U1 U2 10
  set Log2 [dlog get]
  set List2 [split ${Log2} {TD= \t\n}]
  set Tolerance 1.0e-7
  set Limit_Tol 1.0e-7
  set D_good 0.
  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}

  dlog reset
  dlog on
  xdistcs c_$i s2 U1 U2 10
  set Log2 [dlog get]
  set List2 [split ${Log2} {TD= \t\n}]
  set Tolerance 1.0e-7
  set Limit_Tol 1.0e-7
  set D_good 0.
  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
}