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