otismo wrote: ↑
March 15th, 2020, 2:48 am
I would STILL like to be able to load images into your new 240 lines printer...
It really doesn't take a lot of changes to existing scripts to make something like this happen. Have you tried working through the various pieces of loader code to see how they work?
Code: Select all
import golly as g
out = 
sr = g.getselrect()
x0, y0, w, h = sr
for j in range(h):
for i in range(w):
if g.getcell(i+x0, j+y0)==1:
out+=[i*7680+x0,j*7520+y0, i*7680+x0+1,j*7520+y0, i*7680+x0,j*7520+y0+1, i*7680+x0+1,j*7520+y0+1]
Even on a slow computer, it seems like you should be able to manually load a 240-lines image from the above script into an empty printer module, with a little patience. Here again I've left a duoplet to mark the upper left corner location, to make it easy to paste in the output from this script. If you use the full 608-pixel width, you might have to paste in the first three-quarters of the pattern, then run for a while, then paste in the last quarter with a little overlap.
You can also adjust the number of pixels in a printer cycle, by moving the right-hand section over by multiples of 6144. It works a bit better if the move is by a multiple of 6144*5 = 30720, but the system actually works fine with any 6144N adjustment. The only oddity is that for 6144N moves where N is not a multiple of 5, the in-memory copy of the picture being printed ends up getting shifted vertically by 48, 96, 144, or 192. Here's a John 'Horned' Conway image getting reprocessed in this way, and printed at a 609-pixel repeat distance instead of 608 pixels:
Anyone Who Needs Practice Writing Golly Scripts
The previous load-printer-any-height script could easily be adapted to load any width of 240-pixel-high image, using just the part of the code that loads the empty module from a file. It would be better to have two files in this case -- i.e., start by dividing the "240 lines printer empty" pattern into two parts and save them as separate .mc files. Then have the load-printer-240-pixels script use putcells() to drop the two pieces in at the correct offsets relative to the block pattern generated by the above script.
Again it's just a little bit trickier to load a pattern that takes up the entire width of the printer, but it's really just a few lines of code: fill in the part of the blocks pattern that fits, run some number of ticks, then fill in the rest of the blocks.