Polargraph Controller v1.1.7

Hello everyone, an update this way comes!

Version 1.1.7 of the Polargraph Controller brings some significant fixes AND a couple of new features.

  • Density Preview Styles.  This is a naive attempt to make the density preview look a bit like the square wave pixel drawing style.  It uses diamond-shaped squares instead of round spots.

It also uses transparency to give a kind of preview of what happens when they overlap (more on overlapping next).  I was a bit reluctant to add this mode, because it implies that the controller is able to give a preview of what the rendered drawing will look like, rather than simply giving a view of what detail has been captured.  But even though it isn’t perfect, it might be useful. It is the new default, but adding controller.density.preview.style=0 to the config file will make it use circles instead.

  • Pixel scaling.  A customer asked about this image that appears to use a pixel that is scaled AND has variable frequency.  I said of course, there are no secrets in this project, anything I can do you can do.  But then remembered that that drawing was the result of Tinkering, long ago, and there was no way to do this without more Tinkering though it is a good effect.   It was essentially a way to get detail in without obliterating everything else on the page.  Kind of worked.

So I’ve added a Scale Pixel function that will allow you to multiply the size of pixel that get’s drawn.  A value of 1.0 means the pixel is the same size as the grid – just as it always has been.

A value less than 1.0 makes them smaller than the grid, values larger than 1.0 makes them larger than the grid.  This was designed to be used with variable freq square wave, so your mileage may vary when using it with scaled pixels.

  • Crash Fixes!  This is quite a good one, and worth having if you are working with big queues.  This fixes the crash that often occurs when adding large numbers of pixels to an existing queue.  The issue was a ConcurrentModificationException when attempting to read from the command queue to draw it on the screen and adding to the command queue at the same time.  Not allowed to do that.  There are thread-safe versions of the List I use, but they are slow in themselves, so all I did is catch the exception and ignore it and continue on.  The issue is entirely limited to how accurate the command queue will look, on-screen, for a couple of milliseconds, so I am happy to behave badly with that one.  HOWEVER, it is unlikely to come up again anyway, because…
  • Performance is improved with long queues.  Previously it would write out all the entries in the queue, even if they weren’t on the page.  Now, writing anything to the screen is pretty slow, so this has been made 500 times faster (literally) by not doing that unless there’s something to show.  It was pretty lazy coding anyway.

Ok, that’s all folks, as usual, this code is available in the repository or in a couple of downloads.

If there’s any issues, please let me know.

11 thoughts on “Polargraph Controller v1.1.7

  1. Thanks, Sandy! Life/work has conspired to keep me away from my polargraph for a while and I can’t wait to get back to it, especially after seeing this new development.

    • Pesky work/life, always getting in the way of .. er.. whatever this is. The pixel scaling might be useful with your layered drawings Kong, but the queue crash fix and the performance boost is the real win in this update. Can work with much longer queues than previously, before it starts slowing down. And turning off the queue preview even eliminates that.

  2. I woke up this morning with one of those “Hey, wait a minute…” feelings. I realized that the “Scale Pixel” feature is what I’ve always wanted to make the “scribble” style more useful. Previously, since the scribbles were confined to their “pixel” boundaries, the grid was always too obvious. Now that the scribbles can be drawn “outside of the lines”, the drawing comes out looking more random, as you’d want a scribbled drawing to look.

    I couldn’t resist testing this out, other responsibilities be damned, and it looks very good. There was another discovery today, btw, since summer has hit my workroom hard: BIC ballpoint ink flows much more freely at 90°F — and I should buy a fan for the motor drivers.

    • I know what you mean about the scribble pixel – my most pleasing results with scribble where when it was set to expand a couple of steps after every line. The pixel boundaries totally disappeared, but there was also a big loss of detail in the image. Didn’t matter in my case, but it kind of needed tuning for each image. I think the scribble pixel already does have a slight increase in boundary, the size is multiplied by 1.1 or something like that.

  3. Hi Sandy,
    I have my first paying customer for a drawing, but I can’t seem to get my machine working. It’s been a while since I updated my arduino and processing code so i downloaded your latest updates. The Arduino sketch compiled nicely but it wouldn’t load into the Arduino. I was getting the error

    avrdude: stk500_paged_write(): (a) protocol error, expect=0x14,
    avrdude: stk500_cmd(): programmer is out of sync

    I have the newest Arduino 1.0.1. and am trying to upload to an UNO. Do you have an idea what I can do to fix it? With a slightly older sketch that will upload, the Polargraph program says the UNO is connected but the motors never spin or activate. I have tried to use your older code and now I can’t get any of it to work right. Can you point me in the right direction? I hope this gibberish makes since. I would love to get this working again. Thank you for your time.

          • Works Great. I made a parallel programmer (cheap and easy) and used it to burn a the latest bootloader on my Arduino UNO (original). Once I did that I was able to load your latest sketch and it works well with the newest Processing program.

          • I had the same problem – not sure what my version was before, but uploading with whatever bootloader’s included with Arduino 1.0.4 fixed it.

Comments are closed.