1#1 - create Box using short-cut 2NewCommand D 3AddDriver D Box; ## add box driver to driver table 4set B1 [AddBox D 130 140 150]; ## add box 5ComputeFun D $B1:1; ## compute box1 function 6GetShape D $B1:1:2 Box1; ## check result 7whatis Box1 8# refers to result NS 9GetReference D $B1; ## check is reference set 10 11 12#2 - create main sphere 13AddDriver D Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet 14NewCommand D 15explode Box1 V 16set SPnt1 [AttachShape D Box1_1 ${B1} ${B1} 0]; ## set attachment 17erase Box1 18 19set Sph0 [AddSphere D $SPnt1 250] 20ComputeFun D $Sph0:1 21GetShape D $Sph0:1:2 Sp0 22 23#3 create Sphere1 24NewCommand D 25set Sph1 [AddSphere D $SPnt1 30] 26ComputeFun D $Sph1:1 27GetShape D $Sph1:1:2 Sp1 28 29NewCommand D 30set FTr1 [PTranslateDXYZ D $Sph1 0 -251 0] 31ComputeFun D $FTr1 32GetShape D $Sph1:2:2 Sp1 33 34#4 create Sphere2 35NewCommand D 36set Sph2 [AddSphere D $SPnt1 30] 37ComputeFun D $Sph2:1 38GetShape D $Sph2:1:2 Sp2 39 40set FTr2 [PTranslateDXYZ D $Sph2 0 251 0] 41ComputeFun D $FTr2 42GetShape D $Sph2:2:2 Sp2 43 44#5 create Sphere3 45NewCommand D 46set Sph3 [AddSphere D $SPnt1 30] 47ComputeFun D $Sph3:1 48GetShape D $Sph3:1:2 Sp3 49 50explode Box1 E 51set Sel3 [AttachShape D Box1_1 ${B1} ${B1} 0]; 52set FR3 [PRotateRoundLine D $Sph3 $Sel3 120] 53ComputeFun D $FR3 54GetShape D $FR3:2 Sp3 55 56set FTr3 [PTranslateDXYZ D $Sph3 -251 0 0] 57ComputeFun D $FTr3 58GetShape D $Sph3:3:2 Sp3 59 60#6 create Sphere4 61NewCommand D 62set Sph4 [AddSphere D $SPnt1 30] 63ComputeFun D $Sph4:1 64GetShape D $Sph4:1:2 Sp4 65 66set FTr4 [PTranslateDXYZ D $Sph4 251 -40 0] 67ComputeFun D $FTr4 68GetShape D $Sph4:2:2 Sp4 69 70#7 Cut spheres 71set Cut1 [AddCut D $Sph0 $Sph1] 72ComputeFun D $Cut1 73GetShape D $Cut1:2 Sp0 74 75set Cut2 [AddCut D $Sph0 $Sph2] 76ComputeFun D $Cut2 77GetShape D $Cut2:2 Sp0 78 79set Cut3 [AddCut D $Sph0 $Sph3] 80ComputeFun D $Cut3 81GetShape D $Cut3:2 Sp0 82 83set Cut4 [AddCut D $Sph0 $Sph4] 84ComputeFun D $Cut4 85GetShape D $Cut4:2 Sp0 86 87 88#5 test selection 89NewCommand D 90set SL [TestSingleSelection D $Sph0 0] 91set SL2 [TestMultipleSelection D $Sph0 0] 92 93#6 modification 94NewCommand D 95BoxDZ D $B1 270 96 97#7 recomputation 98NewCommand D 99InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented) 100ComputeFun D $B1:1 101ComputeFun D $SPnt1:1 102ComputeFun D $Sph0:1 103ComputeFun D $Sph1:1 104ComputeFun D $FTr1 105ComputeFun D $Sph2:1 106ComputeFun D $FTr2 107ComputeFun D $Sph3:1 108ComputeFun D $Sel3:1 109ComputeFun D $FR3 110ComputeFun D $FTr3 111ComputeFun D $Sph4:1 112ComputeFun D $FTr4 113ComputeFun D $Cut1 114ComputeFun D $Cut2 115ComputeFun D $Cut3 116ComputeFun D $Cut4 117erase 118GetShape D $Cut4:2 Sp0 119 120 121#recomputation of entities of the TestSelection commands 122SolveFlatFrom D $SL 123NewCommand D 124 125