File: bug163

package info (click to toggle)
opencascade 7.3.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 278,376 kB
  • sloc: cpp: 1,136,010; ansic: 81,569; tcl: 14,864; cs: 5,173; java: 1,522; xml: 468; sh: 375; perl: 37; makefile: 25
file content (47 lines) | stat: -rwxr-xr-x 1,051 bytes parent folder | download | duplicates (11)
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

puts "========"
puts "OCC163"
puts "========"
puts ""
###########################################################
## The result of extrema command is not correct. 
## Extrema command return max, but it acceptable because relative error near 1.0e-30.
###########################################################

restore [locate_data_file OCC130.brep] res 

checkshape res

line l -120 -100 400 0 0 1
mksurface s res

set che [extrema l s]
set err [llength $che]

# Amount Check
if { $err != 1} {
    puts "Error: Invalid extrema number"
}

set status 0
set info [dump ext_1]
regexp "Parameters : 0 +(\[-0-9*\.+eE\]+)" $info full extLength

# Test max
if { $extLength > 35 && $extLength < 36} {
    set good_dist 35.6687907545308
    checkreal "Max distance:" ${extLength} ${good_dist} 0.01 0.01
    set status 1
}

# Test min
if {$extLength > 0 && $extLength < 1} {
    set good_dist 0.0
    checkreal "Min distance:" ${extLength} ${good_dist} 0.01 0.01
    set status 1
}

# Not min or max
if {$status == 0} {
    puts "Error: wrong extrema point"
}