efd4b232 |
1 | # =================== OCAF ====================== |
2 | # Naming |
3 | # |
4 | # Testing purpose: Naming selection mechanism |
5 | # |
6 | # Test case: F7 (test special cases of type migration) |
7 | # 1. Create 4 points: $Pnt1 - $Pnt4 |
8 | # 2. Create closed line $Lin2 |
9 | # 3. Create prism Pr ($Prism) |
10 | # 4. Addbox $B1 |
11 | # 5. Translate box $B1 along XYZ |
12 | # 6. $Com1 = Common ($Prism, $B1) |
13 | # 7. Add cylinder $Cyl |
14 | # 8. Translate cylinder $Cyl along XYZ |
15 | # 9. Cut $Cut1 = Cut ($Prism, $Cyl) |
16 | # 10. Make 4 selections (Select edges 8,9, 11+, 11) |
17 | # 11. Modify $Pnt1 |
18 | # 12. Recompute |
19 | # =============================================== |
20 | |
40093367 |
21 | #pload FULL |
40093367 |
22 | erase |
23 | Close D |
24de79c3 |
24 | |
40093367 |
25 | NewDocument D MDTV-Standard |
26 | isos 12 |
efd4b232 |
27 | |
40093367 |
28 | #1 - create 4 Pnts |
29 | NewCommand D |
30 | AddDriver D PntXYZ PntRLT Line3D Attach; |
31 | set Pnt1 [AddPoint D 0 0 0]; ## add point1 |
32 | ComputeFun D $Pnt1:1; ## compute function |
33 | GetShape D $Pnt1:1:2 P1; ## check result |
34 | whatis P1 |
35 | # referes to result NS |
36 | GetReference D $Pnt1; ## check is reference set |
37 | |
38 | set Pnt2 [AddPoint D 0 200 0]; |
39 | ComputeFun D $Pnt2:1; |
40 | set Pnt3 [AddPoint D 200 200 0]; |
41 | ComputeFun D $Pnt3:1; |
42 | set Pnt4 [AddPoint D 200 0 0]; |
43 | ComputeFun D $Pnt4:1; |
44 | GetShape D $Pnt2:1:2 P2; |
45 | GetShape D $Pnt3:1:2 P3; |
46 | GetShape D $Pnt4:1:2 P4; |
47 | |
efd4b232 |
48 | #2 create closed Lin2 |
40093367 |
49 | NewCommand D |
50 | set Lin2 [ AddLine3D D 1 $Pnt1 $Pnt2 $Pnt3 $Pnt4] |
51 | ComputeFun D $Lin2:1; |
52 | GetShape D $Lin2:1:2 L1; |
53 | |
efd4b232 |
54 | #3 Prism |
40093367 |
55 | NewCommand D |
56 | AddDriver D Prism Box PTxyz |
57 | set Prism [AddPrism D $Lin2 300 0] |
58 | ComputeFun D $Prism:1 |
59 | GetShape D $Prism:1:2 Pr |
60 | GetReference D $Prism; ## check is reference set |
61 | |
efd4b232 |
62 | #4 Add Box |
40093367 |
63 | NewCommand D |
64 | set B1 [AddBox D 400 140 600]; |
65 | ComputeFun D $B1:1; |
66 | GetShape D $B1:1:2 Box; |
67 | |
efd4b232 |
68 | #5 Translate Box1 |
40093367 |
69 | NewCommand D |
70 | set FTr1 [PTranslateDXYZ D $B1 -100 -20 -100] |
71 | ComputeFun D $FTr1 |
72 | GetShape D $B1:2:2 Box |
73 | |
efd4b232 |
74 | #6 add Common |
40093367 |
75 | NewCommand D |
76 | AddDriver D Comm Cut Fuse |
77 | set Com1 [AddCommon D $Prism $B1] |
78 | ComputeFun D $Com1 |
79 | GetShape D $Com1:2 Pr |
80 | |
efd4b232 |
81 | #7 Add Cylinder |
40093367 |
82 | NewCommand D |
83 | explode Pr E |
84 | AddDriver D Attach Cyl |
4e57c75e |
85 | set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment |
40093367 |
86 | set Cyl [AddCyl D 70 515 ${Sel1}] |
87 | ComputeFun D $Cyl:1 |
88 | GetShape D $Cyl:1:2 CylS |
89 | |
efd4b232 |
90 | #8 Translate Cylinder |
40093367 |
91 | NewCommand D |
92 | set FTr1 [PTranslateDXYZ D $Cyl -100 200 170] |
93 | ComputeFun D $FTr1 |
94 | GetShape D $Cyl:2:2 CylS |
95 | |
efd4b232 |
96 | #9 Cut |
40093367 |
97 | NewCommand D |
98 | set Cut1 [AddCut D $Prism $Cyl] |
99 | ComputeFun D $Cut1 |
100 | GetShape D $Cut1:2 Pr |
101 | don Pr |
102 | |
efd4b232 |
103 | #10 Select edges 8,9, 11 (test special cases of type migration) |
40093367 |
104 | explode Pr E |
105 | erase Pr_1 Pr_2 Pr_3 Pr_4 Pr_5 Pr_6 Pr_7 Pr_8 Pr_9 Pr_10 Pr_11 Pr_12 Pr_13 Pr_14 Pr_15 Pr_16 Pr_17 |
106 | display Pr_8 Pr_9 |
efd4b232 |
107 | ## ==> 8,9 |
40093367 |
108 | NewCommand D |
109 | set Sel8 [AttachShape D Pr_8 ${Prism} ${Prism} 0]; ## should return Compound of two edges |
110 | set Sel9 [AttachShape D Pr_9 ${Prism} ${Prism} 1]; ## should return Compound of two edges |
111 | set Sel11 [AttachShape D Pr_11 ${Prism} ${Prism} 1]; |
112 | set Sel12 [AttachShape D Pr_11 ${Prism} ${Prism} 0]; |
efd4b232 |
113 | |
114 | #11 modify |
40093367 |
115 | PntOffset D $Pnt1 40 25 skip |
116 | |
efd4b232 |
117 | #12 recompute |
40093367 |
118 | ComputeFun D $Pnt1:1 |
119 | ComputeFun D $Lin2:1 |
120 | ComputeFun D $Prism:1 |
121 | ComputeFun D $Com1 |
122 | ComputeFun D $Sel1:1 |
123 | ComputeFun D $Cyl:1 |
124 | ComputeFun D $FTr1 |
125 | ComputeFun D $Cut1 |
126 | erase |
127 | GetShape D $Cut1:2 Pr |
128 | |
129 | ComputeFun D $Sel8:1 |
130 | ComputeFun D $Sel9:1 |
131 | ComputeFun D $Sel11:1 |
132 | ComputeFun D $Sel12:1 |
133 | NewCommand D |
134 | |