0e94a94e |
1 | puts "TODO OCC12345 ALL: Faulty OCC9" |
2 | |
3 | puts "================" |
4 | puts "OCC9" |
5 | puts "================" |
6 | puts "" |
7 | |
8 | pload QAcommands |
9 | restore [locate_data_file OCC9-path.draw] d |
10 | ############### checkshape d # is not a topological shape |
11 | restore [locate_data_file OCC9-cur1.draw] b |
12 | ############### checkshape b # is not a topological shape |
13 | restore [locate_data_file OCC9-cur2.draw] c |
14 | ############### checkshape c # is not a topological shape |
15 | |
16 | ## compute radius |
17 | cvalue b 0 x y z |
18 | cvalue b 0 P0 |
19 | vertex V [dval x] [dval y] [dval z] |
20 | |
21 | mkedge E d |
22 | distmini dm V E |
23 | |
24 | ## make pipe |
25 | set tolerance 0.0001 |
26 | OCC9 res d b c [dval dm_val] ${tolerance} |
27 | |
28 | ## check parametrization |
29 | |
30 | # puts "Path 0: [dval x] [dval y] [dval z]" |
31 | |
32 | # cvalue b 1 x y z |
33 | # cvalue b 1 P1 |
34 | # puts "Path 1: [dval x] [dval y] [dval z]" |
35 | |
36 | # svalue res 0 0 x y z |
37 | # svalue res 0 0 S0 |
38 | # puts "Surf 0 0: [dval x] [dval y] [dval z]" |
39 | |
40 | # svalue res 0 1 x y z |
41 | # svalue res 0 1 S1 |
42 | # puts "Surf 0 1: [dval x] [dval y] [dval z]" |
43 | |
44 | set n 1 |
45 | set sum 0 |
46 | for {set i -470} {$i < 240} {incr i 25} { |
47 | # cvalue d $i "P$n" |
48 | # svalue res 0 $i "S$n" |
49 | # puts "donly res P$n S$n" |
50 | incr n |
51 | # puts "n = $n i = $i" |
52 | |
53 | ####cvalue d $i x y z |
54 | cvalue b $i x y z |
55 | svalue res 0 $i xs ys zs |
56 | set dist [expr sqrt (\ |
57 | ( [dval x ] - [dval xs ] ) * ( [dval x ] - [dval xs ] )\ |
58 | + ( [dval y ] - [dval ys ] ) * ( [dval y ] - [dval ys ] )\ |
59 | + ( [dval z ] - [dval zs ] ) * ( [dval z ] - [dval zs ] )\ |
60 | ) ] |
61 | set sum [expr $sum + $dist ] |
62 | puts "1-st Dist at $i : $dist" |
63 | |
64 | ####cvalue d $i x y z |
65 | cvalue c $i x y z |
66 | ####svalue res 0 $i xs ys zs |
67 | svalue res 1 $i xs ys zs |
68 | set dist [expr sqrt (\ |
69 | ( [dval x ] - [dval xs ] ) * ( [dval x ] - [dval xs ] )\ |
70 | + ( [dval y ] - [dval ys ] ) * ( [dval y ] - [dval ys ] )\ |
71 | + ( [dval z ] - [dval zs ] ) * ( [dval z ] - [dval zs ] )\ |
72 | ) ] |
73 | set sum [expr $sum + $dist ] |
74 | puts "2-nd Dist at $i : $dist" |
75 | |
76 | } |
77 | ####puts "\n Avg dist on $n intervals: [expr $sum / $n ]" |
78 | set Avg_dist [expr $sum / (2 * $n) ] |
79 | puts "\n Avg dist on $n intervals: ${Avg_dist}" |
80 | |
81 | set check_dist ${tolerance} |
82 | puts "\n check_dist = ${check_dist}" |
83 | if { ${Avg_dist} > ${check_dist} } { |
84 | puts "\n Faulty OCC9" |
85 | } else { |
86 | puts "\n OCC9: OK" |
87 | } |
88 | |
89 | set 2dviewer 0 |