File: bug9303

package info (click to toggle)
oce 0.17.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 297,992 kB
  • ctags: 203,291
  • sloc: cpp: 1,176,369; ansic: 67,206; sh: 11,647; tcl: 6,890; cs: 5,221; python: 2,867; java: 1,522; makefile: 338; xml: 292; perl: 37
file content (107 lines) | stat: -rw-r--r-- 3,300 bytes parent folder | download | duplicates (6)
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
puts "============"
puts "OCC9303"
puts "============"
puts ""
######################################################
# Intersection curve surface doesn't take account of bounds of the surface
######################################################

set BugNumber OCC9303

proc GetPercent {Value GoodValue} {
   set Percent 0.
   if {${GoodValue} != 0.} {
      set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
   } elseif {${Value} != 0.} {
      set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
   } else {
      set Percent 0.
   }
   return ${Percent}
}

cone c 0 0 0 30 0
trimv nc c 20 30

smallview +X+Z
donly nc
fit

line ll 0 0 20 1 0 0

if [catch {intersect res ll nc} result] {
   set mistake 1
} else {
   set  mistake 0
}
                                                                                                
if { $mistake == 0} {                                                                           
   puts "${BugNumber} OK : intersection was finished"                 
   puts ""
   set nom 0
   set j 1
   repeat 2 {
     set che [whatis res_$j]
     set err [lindex $che [expr [llength $che] - 1]]
     if { $err != "point"} {
        break
     } else {
        set nom [expr $nom + 1]
     }
     incr j
   }
   if { $nom != 2 } {
      puts [format "Faulty ${BugNumber}: Intersection was made WRONGLY: %s points" $nom]
   } else {
      puts [format "${BugNumber} OK : Intersection command works properly: %s points" $nom]

      set dump1 [dump res_1]
      set x1 [lindex ${dump1} 7]
      set y1 [lindex ${dump1} 8]
      set z1 [lindex ${dump1} 9]
      set x1 [string range ${x1} 0 end-1]
      set y1 [string range ${y1} 0 end-1]

      set dump2 [dump res_2]
      set x2 [lindex ${dump2} 7]
      set y2 [lindex ${dump2} 8]
      set z2 [lindex ${dump2} 9]
      set x2 [string range ${x2} 0 end-1]
      set y2 [string range ${y2} 0 end-1]

      set percent_max 0.1
      set GoodX1 1.154700538379251e+01
      set GoodY1 0.000000000000000e+00
      set GoodZ1 2.000000000000000e+01
      set GoodX2 -1.154700538379251e+01
      set GoodY2 0.000000000000000e+00
      set GoodZ2 2.000000000000000e+01

      set Percent_x1 [GetPercent ${x1} ${GoodX1}]
      set Percent_y1 [GetPercent ${y1} ${GoodY1}]
      set Percent_z1 [GetPercent ${z1} ${GoodZ1}]

      set Percent_x2 [GetPercent ${x2} ${GoodX2}]
      set Percent_y2 [GetPercent ${y2} ${GoodY2}]
      set Percent_z2 [GetPercent ${z2} ${GoodZ2}]

      if {${Percent_x1} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of x1 = ${x1}"
      } elseif {${Percent_y1} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of y1 = ${y1}"
      } elseif {${Percent_z1} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of z1 = ${z1}"
      } elseif {${Percent_x2} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of x2 = ${x2}"
     } elseif {${Percent_y2} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of y2 = ${y2}"
      } elseif {${Percent_z2} > ${percent_max}} {
        puts "Faulty ${BugNumber}: bad value of z2 = ${z2}"
      } else {
        puts "${BugNumber}: OK"
      }

   }
} else {
   puts "Faulty ${BugNumber} : intersection does not finished"
}