372ceec4 |
1 | puts "==========" |
2 | puts "OCC24869" |
3 | puts "==========" |
4 | puts "" |
5 | ################################################### |
6 | # OCAF testing framework extending |
7 | ################################################### |
8 | |
e837410d |
9 | NewDocument D BinOcaf |
372ceec4 |
10 | |
11 | #1 - create box1 |
12 | NewCommand D |
13 | set B1 [AddObject D] |
14 | set F1 [AddFunction D $B1 Box] |
15 | BoxDX D $B1 100 |
16 | BoxDY D $B1 200 |
17 | BoxDZ D $B1 300 |
18 | InitLogBook D |
19 | AddDriver D Box Section PTxyz |
20 | ComputeFun D $F1 |
21 | GetShape D $F1:2 Box1 |
22 | |
23 | #1 - create box2 |
24 | NewCommand D |
25 | set B2 [AddObject D] |
26 | set F2 [AddFunction D $B2 Box] |
27 | BoxDX D $B2 150 |
28 | BoxDY D $B2 200 |
29 | BoxDZ D $B2 300 |
30 | ComputeFun D $F2 |
31 | |
32 | NewCommand D |
33 | set FTr2 [PTranslateDXYZ D $B2 30 40 50] |
34 | ComputeFun D $FTr2 |
35 | # get modified result |
36 | GetShape D $FTr2:2 Box2 |
37 | |
38 | #3 Make Section Box1 Box2 |
39 | NewCommand D |
40 | set CS [AddSection D $B1 $B2] |
41 | ComputeFun D $CS |
42 | erase |
43 | GetShape D $CS:2 S |
44 | |
45 | # Check result |
46 | NewCommand D |
47 | erase |
48 | ExploreShape D $CS:2:1 R |
49 | |
803a8caf |
50 | # should be 12 edges and 6 vertices |
372ceec4 |
51 | set l1 [llength [directory R_*] ] |
52 | |
803a8caf |
53 | # should be 18 faces |
372ceec4 |
54 | set l2 [llength [directory oldR_*] ] |
55 | |
803a8caf |
56 | if { ${l1} == 18 } { |
372ceec4 |
57 | puts "OK: Good edge number" |
58 | } else { |
59 | puts "Error: Bad edge number" |
60 | } |
61 | |
803a8caf |
62 | if { ${l2} == 18 } { |
372ceec4 |
63 | puts "OK: Good face number" |
64 | } else { |
65 | puts "Error: Bad face number" |
66 | } |