Looking for example of Quil batch rendering...

71 views
Skip to first unread message

Stuart Hungerford

unread,
Oct 27, 2013, 12:56:41 AM10/27/13
to clj-pro...@googlegroups.com
Hi,

I've been perusing the Quil examples and other messages to this group for examples of using Quil in a pure batch-oriented (command line) style.  This may be a misuse of Quil (and Processing) so any advice would be very welcome.  

Essentially I'd like to create a large number of smallish Quil server-side renderings to PDF and PNG files without creating or referencing a GUI window or applet or frame etc. I'm starting to realize that may mean my sketch function cannot have a :draw function as that seems to create a frame.

I'm trying something like this:

(defn render []
  (let [graphics (create-graphics 1500 1000 :pdf "/tmp/foo.pdf")]
    (.beginDraw graphics)
    (smooth)
    (background 255)
    (ellipse 100 100 200 200)
    (.endDraw graphics)))


(defn  graphics []
  (sketch
    :title "my title" 
    :setup render))


With the PDF graphics I'm ending up with a zero-byte PDF file and with the :java2D graphics I'm getting crashes or GUI windows popping up. I'm using .beginDraw and .endDraw as my test code (run from the REPL) complains about not seeing the with-graphics macro.  I'm almost certainly missing something important here, particularly with handling the graphics context and ending the process and writing the graphics file.

Any advice much appreciated,

Thanks,

Stu

Dan Bernier

unread,
Oct 27, 2013, 12:08:01 PM10/27/13
to clj-pro...@googlegroups.com

I'm only lurking on the quil forum, and haven't had time to play with it yet, so this may off base, but: I know that batch processing, or headless rendering, comes up a lot in the processing forums, and as far as I know, the answer is always that you can't do it. Rendering a bunch of files in a draw loop might be your best bet.

--
You received this message because you are subscribed to the Google Groups "clj-processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clj-processin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages