home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 27 / 64er_Magazin_Sonderheft_27_19xx_Markt__Technik_de_Disk_2_of_2_Side_B.d64 / plottomat (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  7KB  |  366 lines

  1. 900 rem *******************************
  2. 910 rem *                             *
  3. 920 rem *         plottomat           *
  4. 930 rem *                             *
  5. 940 rem *  1987 by stefan sablatnoeg  *
  6. 950 rem *                             *
  7. 960 rem *******************************
  8. 970 :
  9. 980 :
  10. 990 :
  11. 1000 :
  12. 1010 rem
  13. 1020 rem  titelausgabe
  14. 1030 rem
  15. 1040 :
  16. 1050 clr
  17. 1060 poke53280,15:poke53281,15:print"[144]"
  18. 1070 print"[147]               plottomat"
  19. 1080 print"               ---------"
  20. 1090 print"         plotprogramm fuer ped"
  21. 1100 print"              5.9.-12.9.87"
  22. 1110 print"          by stefan sablatnoeg"
  23. 1120 fori=1to2000:next
  24. 1130 :
  25. 1140 rem
  26. 1150 rem  eingabe und deklaration
  27. 1160 rem  einiger variablen
  28. 1170 rem
  29. 1180 :
  30. 1190 input"[147]wie viele objekte";ob
  31. 1200 dimn$(ob),p(ob),l(ob),a$(10,ob),b$(20),fo(ob+1)
  32. 1210 fori=1toob
  33. 1220 print"[147]name des "i". plotfiles";:inputn$(i)
  34. 1230 next
  35. 1240 fort=1toob
  36. 1250 print"[147]0 - schwarz  1 - blau  2 - gruen 3 - rot[144]"
  37. 1260 print"farbe des "t". objektes (0-3)";:inputfo(t)
  38. 1270 next
  39. 1280 print"[147]0 - schwarz  1 - blau  2 - gruen 3 - rot[144]"
  40. 1290 input"farbe der schrift (0-3)";fs
  41. 1300 print"[147]0 - schwarz  1 - blau  2 - gruen 3 - rot[144]"
  42. 1310 input"farbe des rahmens um die beschriftung";fr
  43. 1320 rem abfragen zum design
  44. 1330 print"[147]rahmen um grafik zeichnen ?"
  45. 1340 poke198,0:wait198,1:getg$:ifg$="j"thenra=1:goto1360
  46. 1350 ifg$<>"n"then1330
  47. 1360 print"[147]punktnummern  einzeichnen ?"
  48. 1370 poke198,0:wait198,1:getg$:ifg$="j"thennu=1:goto1392
  49. 1380 ifg$<>"n"then1360
  50. 1392 print"[147]objektblock      zeichnen ?"
  51. 1394 poke198,0:wait198,1:getg$:ifg$="j"thenbl=1:goto1460
  52. 1396 ifg$<>"n"then1392
  53. 1398 :
  54. 1400 rem
  55. 1410 rem eingaben abgeschlossen
  56. 1420 rem
  57. 1430 rem daten files lesen
  58. 1440 rem
  59. 1450 :
  60. 1460 print"[147]--->  bitte legen sie die  diskette  mit"
  61. 1470 print"      den/m plotfile(s) ein  und  machen"
  62. 1480 print"      sie den plotter fertig.......taste"
  63. 1500 poke198,0:wait198,1:poke198,0
  64. 1510 open15,8,15
  65. 1520 print"[147]reading ";
  66. 1530 fork=1toob
  67. 1540 open1,8,2,n$(k)+",s,r"
  68. 1550 gosub4450
  69. 1560 ife<>0then1050
  70. 1570 input#1,p(k):input#1,l(k)
  71. 1580 gosub4450
  72. 1590 ife<>0then1050
  73. 1600 p(k)=p(k)+1:l(k)=l(k)+1
  74. 1610 p=p+p(k):l=l+l(k)
  75. 1620 close1
  76. 1630 next
  77. 1640 rem
  78. 1650 rem groesse bestimmt nun felder
  79. 1660 rem dimensionieren
  80. 1670 rem und daten einlesen
  81. 1680 rem
  82. 1690 dim x(p+1),y(p+1),n%(p+1),l1%(l+1),l2%(l+1)
  83. 1700 yi=999999:xi=999999
  84. 1710 il=1:ip=0:pa=0:fork=1toob
  85. 1720 open1,8,2,n$(k)+",s,r"
  86. 1730 gosub4450
  87. 1740 ife<>0then1050
  88. 1750 input#1,ph:input#1,lh
  89. 1760 gosub4450
  90. 1770 ife<>0then1050
  91. 1780 forj=0toph
  92. 1790 input#1,n%(ip),x,y
  93. 1800 gosub4450
  94. 1810 ife<>0then1050
  95. 1820 print".";
  96. 1830 ifn%(ip)=-1thenx=-1:y=-1:goto1860
  97. 1840 ifx<xithenxi=x
  98. 1850 ify<yithenyi=y
  99. 1860 x(ip)=x:y(ip)=y
  100. 1870 ip=ip+1
  101. 1880 nextj
  102. 1890 forj=0tolh
  103. 1900 input#1,p1,p2
  104. 1910 gosub4450
  105. 1920 ife<>0then1050
  106. 1930 ifp1=-1orp2=-1thenl1%(il)=p1:l2%(il)=p2:goto1960
  107. 1940 print".";
  108. 1950 l1%(il)=p1+pa:l2%(il)=p2+pa
  109. 1960 il=il+1
  110. 1970 nextj
  111. 1980 forj=0to10
  112. 1990 input#1,a$(j,k)
  113. 2000 gosub4450
  114. 2010 ife<>0then1050
  115. 2020 nextj
  116. 2030 close1
  117. 2040 pa=ip
  118. 2050 nextk
  119. 2060 close15
  120. 2070 :
  121. 2080 :
  122. 2090 rem
  123. 2100 rem ende des einlesens
  124. 2110 rem
  125. 2120 rem groesse des objekts optimieren
  126. 2130 rem
  127. 2140 :
  128. 2150 :
  129. 2160 print:print"[147]thinking "
  130. 2170 fori=0top
  131. 2180 ifx(i)=-1then2200
  132. 2190 x(i)=x(i)-xi:y(i)=y(i)-yi
  133. 2200 next
  134. 2210 fori=0top
  135. 2220 ifx(i)>xmthenxm=x(i)
  136. 2230 ify(i)>ymthenym=y(i)
  137. 2240 next
  138. 2250 tu=0
  139. 2260 ifxm>ym then2320
  140. 2270 h=xm:xm=ym:ym=h
  141. 2280 fori=0top
  142. 2290 h=x(i):x(i)=y(i):y(i)=h
  143. 2300 next
  144. 2310 tu=1
  145. 2320 f1=998/xm:f2=479/ym
  146. 2330 f=f1:iff2<f1thenf=f2
  147. 2340 fori=0top
  148. 2350 ifx(i)=-1then2380
  149. 2360 x(i)=int(x(i)*f):y(i)=int(y(i)*f):iftu=1thenx(i)=xm*f-x(i)
  150. 2370 h=x(i):x(i)=y(i):y(i)=h
  151. 2380 next
  152. 2390 iff=f2then2460
  153. 2400 add=(479-ym*f)/2
  154. 2410 fori=0top
  155. 2420 ifx(i)<>-1thenx(i)=x(i)+add
  156. 2430 next
  157. 2440 :
  158. 2450 :
  159. 2460 rem
  160. 2470 rem ende der anpassung
  161. 2480 rem
  162. 2490 rem plotten des objektes
  163. 2500 rem
  164. 2510 :
  165. 2520 :
  166. 2530 print:print"[147]plotting";
  167. 2540 open1,6,1:open2,6,2:open3,6,3:open4,6,4:open7,6
  168. 2550 print#3,1:print#7:print#4,0
  169. 2560 print#2,fo(1)
  170. 2570 rem
  171. 2580 fori=1tol
  172. 2590 ifl1%(i)=-1orl2%(i)=-1then2660
  173. 2600 ifi=1then2620
  174. 2610 if(l2%(i)=l2%(i-1))or((r=1)and(l2%(i)=l1%(i-1)))then3800
  175. 2620 r=0
  176. 2630 print#1,"m";x(l1%(i)),-y(l1%(i))
  177. 2640 print#1,"d";x(l2%(i)),-y(l2%(i))
  178. 2650 print".";
  179. 2660 lk=0:fort=1toob
  180. 2670 lk=lk+l(t)
  181. 2680 ifi=lkthenprint#2,fo(t+1)
  182. 2690 next
  183. 2700 next
  184. 2710 :
  185. 2720 :
  186. 2730 rem
  187. 2740 rem objekt geplottet
  188. 2750 rem
  189. 2760 rem punktnummern einzeichnen
  190. 2770 rem
  191. 2780 :
  192. 2790 :
  193. 2800 if nu=0then3080
  194. 2810 iftu=0then2920
  195. 2820 print#4,0:print#3,0:print#2,fs:fori=0top-1:xp=x(i):yp=-y(i)
  196. 2830 ifn%(i)=-1then2890
  197. 2840 ifyp<-xm*f+2thenyp=-xm*f+2
  198. 2850 ifyp>-10thenyp=-10
  199. 2860 nr$=str$(n%(i)):nr$=right$(nr$,len(nr$)-1)
  200. 2870 ifxp>455thenxp=479-6*len(nr$)
  201. 2880 print#1,"m";xp;yp:print#7,nr$;
  202. 2890 next:goto3080
  203. 2900 rem
  204. 2910 rem
  205. 2920 print#4,1:print#3,0:print#2,fs:fori=0top-1:xp=x(i):yp=-y(i)
  206. 2930 ifn%(i)=-1then3000
  207. 2940 ifyp<-xm*f+2thenyp=-xm*f+2
  208. 2950 ifyp>-10thenyp=-10
  209. 2960 nh$=str$(n%(i)):nh$=right$(nh$,len(nh$)-1)
  210. 2970 nr$="":forj=1tolen(nh$):nr$=mid$(nh$,j,1)+" "+nr$:next
  211. 2980 ifxp>431thenxp=479-6*len(nr$)
  212. 2990 print#1,"m";xp;yp:print#7,nr$;
  213. 3000 next
  214. 3010 :
  215. 3020 :
  216. 3030 rem
  217. 3040 rem rahmen wenn gewuenscht
  218. 3050 rem
  219. 3060 :
  220. 3070 :
  221. 3080 ifra<>1then3130
  222. 3090 print#2,fr
  223. 3100 print#1,"m";0;0:print#1,"d";0;-xm*f
  224. 3110 print#1,"d";479,-xm*f:print#1,"d";479;0
  225. 3120 print#1,"d";0;0
  226. 3130 print#1,"m";0;-xm*f
  227. 3140 :
  228. 3150 :
  229. 3160 rem
  230. 3170 rem objektblock auswaehlen und plotten
  231. 3180 rem
  232. 3190 :
  233. 3200 :
  234. 3210 ifbl=0thenprint#7:print#7:print#7:print#7:goto3640
  235. 3215 iftu=0then3900:rem objekt wurde nicht gedreht
  236. 3220 rem ab hier objektblock fuer gedrehtes objekt
  237. 3230 fork=1toob
  238. 3240 print#2,fs
  239. 3250 print#3,1
  240. 3260 print#7
  241. 3270 print#3,0
  242. 3280 print#7," augenpunkt : x :";a$(1,k)
  243. 3290 print#7,"            : y :";a$(3,k)
  244. 3300 print#7,"            : z :";a$(5,k)
  245. 3310 print#7," blickpunkt : x :";a$(2,k)
  246. 3320 print#7,"            : y :";a$(4,k)
  247. 3330 print#7,"            : z :";a$(6,k)
  248. 3340 print#7," zoomfaktor     :";a$(8,k)
  249. 3350 print#7," blickwinkel    :";a$(9,k)
  250. 3360 print#7," bildgroesse    :";a$(7,k);
  251. 3370 print#3,3
  252. 3380 print#7:print#7," objekt:"
  253. 3390 print#2,fo(k)
  254. 3400 print#7," "left$(n$(k),9):print#7," "mid$(n$(k),10,6);
  255. 3410 print#2,fr
  256. 3420 print#1,"m";0;0:print#1,"d";0;330:print#1,"d";479;330
  257. 3430 print#1,"d";479;0:print#1,"d";0;0
  258. 3440 print#1,"m";0;300:print#1,"d";479;300
  259. 3450 print#1,"m";479;269:print#1,"d";0;269
  260. 3460 print#1,"m";0;259:print#1,"d";479;259
  261. 3470 print#1,"m";479;249:print#1,"d";0;249
  262. 3480 print#1,"m";0;239:print#1,"d";479;239
  263. 3490 print#1,"m";479;160:print#1,"d";0;160
  264. 3500 print#3,0
  265. 3510 fori=1to16:print#7:next
  266. 3520 rem
  267. 3530 nextk
  268. 3540 print#3,1:print#7:print#7:print#7:print#7:print#7
  269. 3550 :
  270. 3560 :
  271. 3570 rem
  272. 3580 rem ende des gedrehten objektblocks
  273. 3590 rem
  274. 3600 rem gleiches objekt nochmal ????
  275. 3610 rem
  276. 3620 :
  277. 3630 :
  278. 3640 print"[147]das selbe objekt"
  279. 3650 print"nochmal plotten ? (j/n)":poke198,0:wait198,1:getg$:ifg$="j"thenag=1
  280. 3660 ifg$<>"n"andg$<>"j"then3640
  281. 3670 close1:close2:close3:close4:close7
  282. 3680 ifag=1thenag=0:goto2530
  283. 3690 print"[147]ein anderes objekt"
  284. 3700 print"plotten ? (j/n)":poke198,0:wait198,1:getg$:ifg$="j"then1050
  285. 3710 ifg$<>"n"then3690
  286. 3720 end
  287. 3730 rem ********************
  288. 3740 rem *ende des programms*
  289. 3750 rem ********************
  290. 3760 rem
  291. 3770 :
  292. 3780 :
  293. 3790 rem linie durchziehen
  294. 3800 r=1
  295. 3810 print#1,"d";x(l1%(i)),-y(l1%(i))
  296. 3820 goto2660
  297. 3830 :
  298. 3840 :
  299. 3850 rem
  300. 3860 rem objektblock fuer nicht gedrehtes objekt
  301. 3870 rem
  302. 3880 :
  303. 3890 :
  304. 3900 fork=1toob
  305. 3910 print#2,fs
  306. 3920 print#4,1
  307. 3930 print#3,0
  308. 3940 rem
  309. 3950 print#7:print#7:print#7
  310. 3960 b$(1)="augenpunkt : x :"+a$(1,k)
  311. 3970 b$(7)="blickpunkt : x :"+a$(2,k)
  312. 3980 b$(3)="           : y :"+a$(3,k)
  313. 3990 b$(9)="           : y :"+a$(4,k)
  314. 4000 b$(5)="           : z :"+a$(5,k)
  315. 4010 b$(11)="           : z :"+a$(6,k)
  316. 4020 b$(17)="bildgroesse    :"+a$(7,k)
  317. 4030 b$(13)="zoomfaktor     :"+a$(8,k)
  318. 4040 b$(15)="blickwinkel    :"+a$(9,k)
  319. 4050 fori=1to18
  320. 4060 iflen(b$(i))<30thenb$(i)=b$(i)+" ":goto4060
  321. 4070 next
  322. 4080 forj=1to30
  323. 4090 fori=18to1step-1
  324. 4100 print#7,mid$(b$(i),j,1);
  325. 4110 next
  326. 4120 print#7
  327. 4130 next
  328. 4140 print#2,fr
  329. 4150 print#1,"m";0;320
  330. 4160 print#1,"d";479;320:print#1,"d";479;0:print#1,"d";0;0:print#1,"d";0;320
  331. 4170 print#1,"m";16;320:print#1,"d";16;0
  332. 4180 print#1,"m";28;320:print#1,"d";28;0
  333. 4190 print#1,"m";40;320:print#1,"d";40;0
  334. 4200 print#1,"m";76;320:print#1,"d";76;0
  335. 4210 print#1,"m";112;320:print#1,"d";112;0
  336. 4220 print#1,"m";112;250:print#1,"d";479;250
  337. 4230 print#1,"m";0;250
  338. 4240 print#2,fs
  339. 4250 print#4,0
  340. 4260 print#3,3
  341. 4270 print#7,"   objekt:"
  342. 4280 print#2,fo(k)
  343. 4290 print#7,"   ";left$(n$(k),7):print#7,"   ";mid$(n$(k),8,7)
  344. 4300 rem
  345. 4310 print#3,0
  346. 4320 print#7
  347. 4330 print#3,1
  348. 4340 next
  349. 4350 print#7:print#7:print#7:print#7
  350. 4360 rem
  351. 4370 rem objektblock fuer nicht gedrehtes objekt ist fertig ->ruecksprung
  352. 4380 rem
  353. 4390 goto3640
  354. 4400 :
  355. 4410 :
  356. 4420 rem
  357. 4430 rem fehlerkanal der floppy
  358. 4440 rem
  359. 4450 input#15,e,e$,e1,e2
  360. 4460 ife=0thenreturn
  361. 4470 print"[147]disk fehler:"
  362. 4480 print"";e;e$;e1;e2"[146]"
  363. 4490 print"bitte problem beheben und nochmal       anfangen   -->taste"
  364. 4500 poke198,0:wait198,1:poke198,0
  365. 4510 return
  366.