図I.2 Mechanical Parts>
10 REM ************************************************
20 REM A Mechanical Part FRI.,10,JULY,1992
30 REM ************************************************
40 REM ***** INITIALIZE
50 CMINIT : DPWIND 0.,0.,200.
60 DIM APOS(2,5),BPOS(2,5),CPOS(3),ANG(3),CEN(3),VECT(3)
70 DIM FAEQ(4),POS1(3),POS2(3),POS3(3),POS4(3)
80 DATA 0.,60.,12.,60.,12.,35.,80.,35.,95.,15., : READ APOS
90 DATA 0.,40.,5.,40.,5.,28.,76.,28.,88.,12., : READ BPOS
100 DATA -10.,-43.,5. : READ POS1
110 DATA 10.,-25.,25. : READ POS2
120 DATA 0.,-70.,0. : READ POS3
130 DATA 70.,0.,100. : READ POS4
140 CPOS(1)=300 : CPOS(2)=-300 : CPOS(3)=300 : TH=0.7
150 DPCAM CPOS,TH
160 REM ***** OBJECTS CREATION ******
170 PRCYLN "PRC1",25,0,22.,90.,1
180 PRCYLN "PRC2",25,0,18.,200.,0
190 PRCYLN "PRD1",6,0,28.,8.,0
200 PRCYLN "PRD2",6,0,28.,8.,1
210 PRCYLN "PRC3",20,0,10.,16.,0
220 PRCYLN "PRC4",15,0,5.,16.,1
230 PREVL "PRE1",APOS,5,25,0.,1
240 ANG(2)=90. : CEN(1)=0
250 PGROT "PRC1",,ANG,CEN,0,0
260 PGROT "PRC2",,ANG,CEN,0,0
270 PGROT "PRD1",,ANG,CEN,0,0
280 PGROT "PRC2",,ANG,CEN,0,0
290 ANG(3)=-90. : ANG(2)= 0.
300 PGROT "PRC3",,ANG,CEN,0,0
310 PGROT "PRC4",,ANG,CEN,0,0
320 VECT(3)=65.
330 PGDIS "PRC1",,VECT,0,0
340 PGDIS "PRC2",,VECT,0,0
350 VECT(1)=45.
360 PGDIS "PRD1",,VECT,0,0
370 VECT(1)=-45.
380 PGDIS "PRD2",,VECT,0,0
390 VECT(1)=0. : VECT(2)=-35. : VECT(3)=25.
400 PGDIS "PRC3",,VECT,0,0
410 PGDIS "PRC4",,VECT,0,0
420 PCUBEM "PRF0",POS1,POS2
430 PUNI "PRC3","PRF0"
440 PUNI "PRC1","PRD2","PRD1"
450 PUNI "PRE1","PRC1"
460 PSUB "PRE1","PRC2"
470 PUNI "PRE1","PRC3"
480 PSUB "PRE1","PRC4"
490 PRCYLN "PRC5",25,0,22.,90.,1
500 PRCYLN "PRC6",25,0,18.,200.,0
510 PRCYLN "PRC7",6,0,28.,8.,0
520 PRCYLN "PRC8",6,0,28.,8.,1
530 VECT(1)=-50.0*SIN(45.0)
540 VECT(2)=VECT(1) : VECT(3)=0.
550 PGDIS "PRC5",,VECT,0,0
560 VECT(2)=-VECT(1)
570 PGDIS "PRC6",,VECT,0,0
580 VECT(1)=-50.0*SIN(45.0)
590 PGDIS "PRC7",,VECT,0,0
600 VECT(2)=-VECT(1)
610 PGDIS "PRC8",,VECT,0,0
620 PSUB "PRE1","PRC5","PRC6","PRC7","PRC8"
630 PREVL "PRE2",BPOS,5,25,0.,1
640 PCUBEM "PRF1",POS3,POS4
650 PSUB "PRE1","PRE2"
660 REM ***** DISPLAY *****
670 CLS : HLDISP "PRE1",0,0
680 REM : PAUSE 5
690 FAEQ(1)=1. : FAEQ(2)=0.
700 PCUT "PRE1",FAEQ,1
710 CLS : HLDISP "PRE1",0,0
720 REM : PAUSE 5
730 PDCOMP "PRE1",2
740 CRENAM "PRE1","PRE2",
750 CLS : HLDISP "PRE1",0,0
760 REM : PAUSE 5
770 CLS : HLDISP "PRE2",0,0
780 END
目次のページ