3113d520 |
1 | puts "TODO ?CR23788 ALL: Failed units" |
2 | |
efd4b232 |
3 | # =================== OCAF ====================== |
4 | # Naming |
5 | # |
6 | # Testing purpose: Naming selection mechanism |
7 | # |
8 | # Test case: E4 (ShapeOrientation is not used) |
9 | # 1. Create box B2 |
10 | # 2. Create cylinder Cyl |
11 | # 3. Translate Cyl along XYZ |
12 | # 4. CS = Cut (B2, Cyl) |
13 | # 5. Make selection for all sub-shapes |
14 | # 6. Modify B2 |
15 | # 7. Recompute modeling functions |
16 | # 8. Recompute selections |
17 | # =============================================== |
40093367 |
18 | #pload FULL |
efd4b232 |
19 | |
40093367 |
20 | erase |
21 | Close D |
24de79c3 |
22 | |
40093367 |
23 | NewDocument D MDTV-Standard |
efd4b232 |
24 | |
40093367 |
25 | AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet |
26 | |
27 | #1 Create Box |
28 | NewCommand D |
29 | set B2 [AddObject D]; ## add object |
30 | set F2 [AddFunction D $B2 Box]; ## add function |
31 | BoxDX D $B2 190; ## set argumets of this function |
32 | BoxDY D $B2 290 |
33 | BoxDZ D $B2 390 |
34 | InitLogBook D; ## initialize (clean) internal maps of labels |
35 | ComputeFun D $F2; ## compute the function |
36 | GetShape D $F2:2 Box2; ## check result |
37 | whatis Box2 |
38 | GetReference D $B2 |
39 | |
40 | #2 Create Cylinder |
41 | NewCommand D |
42 | explode Box2 F |
43 | explode Box2_1 E |
44 | set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment |
45 | ## AddDriver D Attach Cyl |
46 | set Cyl [AddCyl D 70 515 ${Sel1}] |
47 | ComputeFun D $Cyl:1 |
48 | GetShape D $Cyl:1:2 CylS |
49 | |
50 | #3 Translate Cylinder |
51 | NewCommand D |
52 | set FTr1 [PTranslateDXYZ D $Cyl 100 0 0] |
53 | ComputeFun D $FTr1 |
54 | GetShape D $Cyl:2:2 CylS |
55 | |
56 | #4 Cut Box Cyl |
57 | NewCommand D |
58 | set CS [AddCut D $B2 $Cyl] |
59 | ComputeFun D $CS |
60 | erase |
61 | GetShape D $CS:2 S |
62 | don S |
63 | NewCommand D |
64 | |
65 | #5 test Naming |
66 | set SL [TestSingleSelection D $B2 0] |
67 | set SL2 [TestMultipleSelection D $B2 0] |
68 | |
69 | #6 Modification |
70 | NewCommand D |
71 | BoxDX D $B2 250 |
72 | |
73 | #7 recompute |
74 | NewCommand D |
75 | InitLogBook D |
76 | ComputeFun D $F2 |
77 | ComputeFun D $Sel1:1 |
78 | ComputeFun D $Cyl:1 |
79 | ComputeFun D $FTr1 |
80 | ComputeFun D $CS |
81 | erase |
82 | GetShape D $CS:2 S |
83 | don S |
efd4b232 |
84 | |
85 | #8 Recompute selections |
40093367 |
86 | SolveFlatFrom D $SL |
87 | NewCommand D |
88 | |