File: bug12522

package info (click to toggle)
oce 0.15-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 302,472 kB
  • ctags: 210,903
  • sloc: cpp: 1,165,052; ansic: 75,256; sh: 11,901; tcl: 4,488; python: 2,867; makefile: 337; perl: 37; csh: 12
file content (45 lines) | stat: -rwxr-xr-x 1,158 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
puts "TODO ?OCC12345 ALL: OCC12522: Faulty"

puts "========"
puts "OCC12522"
puts "========"
puts ""
###########################################################
# Extrema problems. Case: one of the Extrema arguments is an infinite face or an infinite edge.
###########################################################

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}
}

set BugNumber OCC12522

restore [locate_data_file OCC12522.brep] arc1
explode arc1 e
mkcurve curve1 arc1_1

plane plane1 6400 -4000 -160 0 0 1 1 0 0

extrema curve1 plane1

set percent_max 0.1
set good_length 8.3705138910905177

set ext_1_length [lindex [length ext_1] 4]

set length_percent [GetPercent ${ext_1_length} ${good_length}]
puts "length_percent = ${length_percent}"

if {${length_percent} > ${percent_max}} {
   puts "${BugNumber}: Faulty"
} else {
   puts "${BugNumber}: OK"
}