efd4b232 |
1 | # ============= OCAF ============================ |
2 | # Naming |
3 | # |
4 | # Testing purpose: Naming selection mechanism |
5 | # |
6 | # Test case: F3 (ShapeOrientation is not used) |
7 | # |
8 | # 1. Create Box $B1 |
9 | # 2. Create sphere $Sph0 |
10 | # 3. Create sphere $Sph1 and move it along XYZ |
11 | # 4. Create sphere $Sph2 and move it along XYZ |
12 | # 5. Create sphere $Sph3 and rotate it around line and move after along XYZ |
13 | # 6. Create sphere $Sph4 and move it along XYZ |
14 | # 7. Cut spheres: $Cut1 = Cut($Sph0, $Sph1) |
15 | # $Cut2 = Cut($Sph0, $Sph2) |
16 | # $Cut3 = Cut($Sph0, $Sph3) |
17 | # $Cut4 = Cut($Sph0, $Sph4) |
18 | # 8. Make selection for all sub-shapes |
19 | # 9. Modify B2 |
20 | # 10. Recompute modeling functions |
21 | # 11. Recompute selections |
22 | # =============================================== |
23 | |
24 | |
40093367 |
25 | #pload FULL |
40093367 |
26 | erase |
27 | Close D |
24de79c3 |
28 | |
e837410d |
29 | NewDocument D BinOcaf |
40093367 |
30 | isos 12 |
31 | #1 - create Box using short-cut |
32 | NewCommand D |
33 | AddDriver D Box; ## add box driver to driver table |
34 | set B1 [AddBox D 130 140 150]; ## add box |
35 | ComputeFun D $B1:1; ## compute box1 function |
36 | GetShape D $B1:1:2 Box1; ## check result |
37 | whatis Box1 |
38 | # referes to result NS |
39 | GetReference D $B1; ## check is reference set |
40 | |
41 | |
efd4b232 |
42 | #2 - create main sphere Sp0 |
40093367 |
43 | AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet |
44 | NewCommand D |
45 | explode Box1 V |
46 | set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment |
47 | erase Box1 |
48 | |
49 | set Sph0 [AddSphere D $SPnt1 250] |
50 | ComputeFun D $Sph0:1 |
51 | GetShape D $Sph0:1:2 Sp0 |
52 | |
53 | #3 create Sphere1 |
54 | NewCommand D |
55 | set Sph1 [AddSphere D $SPnt1 30] |
56 | ComputeFun D $Sph1:1 |
57 | GetShape D $Sph1:1:2 Sp1 |
58 | |
59 | NewCommand D |
60 | set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0] |
61 | ComputeFun D $FTr1 |
62 | GetShape D $Sph1:2:2 Sp1 |
63 | |
64 | #4 create Sphere2 |
65 | NewCommand D |
66 | set Sph2 [AddSphere D $SPnt1 30] |
67 | ComputeFun D $Sph2:1 |
68 | GetShape D $Sph2:1:2 Sp2 |
69 | |
70 | set FTr2 [PTranslateDXYZ D $Sph2 0 251 0] |
71 | ComputeFun D $FTr2 |
72 | GetShape D $Sph2:2:2 Sp2 |
73 | |
74 | #5 create Sphere3 |
75 | NewCommand D |
76 | set Sph3 [AddSphere D $SPnt1 30] |
77 | ComputeFun D $Sph3:1 |
78 | GetShape D $Sph3:1:2 Sp3 |
79 | |
80 | explode Box1 E |
81 | set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0]; |
82 | set FR3 [PRotateRoundLine D $Sph3 $Sel3 120] |
83 | ComputeFun D $FR3 |
84 | GetShape D $FR3:2 Sp3 |
85 | |
86 | set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0] |
87 | ComputeFun D $FTr3 |
88 | GetShape D $Sph3:3:2 Sp3 |
89 | |
90 | #6 create Sphere4 |
91 | NewCommand D |
92 | set Sph4 [AddSphere D $SPnt1 30] |
93 | ComputeFun D $Sph4:1 |
94 | GetShape D $Sph4:1:2 Sp4 |
95 | |
96 | set FTr4 [PTranslateDXYZ D $Sph4 251 -40 0] |
97 | ComputeFun D $FTr4 |
98 | GetShape D $Sph4:2:2 Sp4 |
99 | |
100 | #7 Cut spheres |
101 | set Cut1 [AddCut D $Sph0 $Sph1] |
102 | ComputeFun D $Cut1 |
103 | GetShape D $Cut1:2 Sp0 |
104 | |
105 | set Cut2 [AddCut D $Sph0 $Sph2] |
106 | ComputeFun D $Cut2 |
107 | GetShape D $Cut2:2 Sp0 |
108 | |
109 | set Cut3 [AddCut D $Sph0 $Sph3] |
110 | ComputeFun D $Cut3 |
111 | GetShape D $Cut3:2 Sp0 |
112 | |
113 | set Cut4 [AddCut D $Sph0 $Sph4] |
114 | ComputeFun D $Cut4 |
115 | GetShape D $Cut4:2 Sp0 |
116 | |
117 | |
efd4b232 |
118 | #8 test selection |
40093367 |
119 | NewCommand D |
120 | set SL [TestSingleSelection D $Sph0 0] |
121 | set SL2 [TestMultipleSelection D $Sph0 0] |
122 | |
efd4b232 |
123 | #9 modification |
40093367 |
124 | NewCommand D |
125 | BoxDZ D $B1 270 |
126 | |
efd4b232 |
127 | #10 recomputation |
40093367 |
128 | NewCommand D |
129 | InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) |
130 | ComputeFun D $B1:1 |
131 | ComputeFun D $SPnt1:1 |
132 | ComputeFun D $Sph0:1 |
133 | ComputeFun D $Sph1:1 |
134 | ComputeFun D $FTr1 |
135 | ComputeFun D $Sph2:1 |
136 | ComputeFun D $FTr2 |
137 | ComputeFun D $Sph3:1 |
138 | ComputeFun D $Sel3:1 |
139 | ComputeFun D $FR3 |
140 | ComputeFun D $FTr3 |
141 | ComputeFun D $Sph4:1 |
142 | ComputeFun D $FTr4 |
143 | ComputeFun D $Cut1 |
144 | ComputeFun D $Cut2 |
145 | ComputeFun D $Cut3 |
146 | ComputeFun D $Cut4 |
147 | erase |
148 | GetShape D $Cut4:2 Sp0 |
149 | |
150 | |
efd4b232 |
151 | #11 recomputation of entities of the TestSelection commands |
40093367 |
152 | SolveFlatFrom D $SL |
153 | NewCommand D |
154 | |