0e94a94e |
1 | |
2 | puts "========" |
3 | puts "OCC163" |
4 | puts "========" |
5 | puts "" |
6 | ########################################################### |
032d0272 |
7 | ## The result of extrema command is not correct. |
8 | ## Extrema command return max, but it acceptable because relative error near 1.0e-30. |
0e94a94e |
9 | ########################################################### |
10 | |
11 | restore [locate_data_file OCC130.brep] res |
12 | |
352ffd73 |
13 | checkshape res |
0e94a94e |
14 | |
15 | line l -120 -100 400 0 0 1 |
16 | mksurface s res |
17 | |
18 | set che [extrema l s] |
19 | set err [llength $che] |
032d0272 |
20 | |
21 | # Amount Check |
22 | if { $err != 1} { |
23 | puts "Error: Invalid extrema number" |
0e94a94e |
24 | } |
25 | |
032d0272 |
26 | set status 0 |
27 | set info [dump ext_1] |
28 | regexp "Parameters : 0 +(\[-0-9*\.+eE\]+)" $info full extLength |
29 | |
30 | # Test max |
31 | if { $extLength > 35 && $extLength < 36} { |
32 | set good_dist 35.6687907545308 |
33 | checkreal "Max distance:" ${extLength} ${good_dist} 0.01 0.01 |
34 | set status 1 |
35 | } |
0e94a94e |
36 | |
032d0272 |
37 | # Test min |
38 | if {$extLength > 0 && $extLength < 1} { |
39 | set good_dist 0.0 |
40 | checkreal "Min distance:" ${extLength} ${good_dist} 0.01 0.01 |
41 | set status 1 |
0e94a94e |
42 | } |
43 | |
032d0272 |
44 | # Not min or max |
45 | if {$status == 0} { |
46 | puts "Error: wrong extrema point" |
47 | } |