60290ee0a84856b8e6c46491925f3c7219d930e2
[occt.git] / tests / bugs / caf / bug24869
1 puts "=========="
2 puts "OCC24869"
3 puts "=========="
4 puts ""
5 ###################################################
6 # OCAF testing framework extending
7 ###################################################
8
9 NewDocument D BinOcaf
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
50 # should be 12 edges
51 set l1 [llength [directory R_*] ]
52
53 # should be 12 faces
54 set l2 [llength [directory oldR_*] ]
55
56 if { ${l1} == 12 } {
57   puts "OK: Good edge number"
58 } else {
59   puts "Error: Bad edge number"
60 }
61
62 if { ${l2} == 12 } {
63   puts "OK: Good face number"
64 } else {
65   puts "Error: Bad face number"
66 }