On Oct 4, 2007, at 10:47 PM, M. Edward (Ed) Borasky wrote:

> Alex Gutteridge wrote:
>> On 5 Oct 2007, at 10:51, Winter Ayars wrote:
>>> I need to create a small program that generates images and  
>>> "animations"
>>> (i can cheat on the animation) of Petri nets. Something like the
>>> wikipedia page's (http://en.wikipedia.org/wiki/Petri_net)  
>>> examples, but
>>> automatically generated based on simple input.
>>>
>>> I'm thinking about doing this in Ruby (with Gnome 2) but don't  
>>> know what
>>> image generation/manipulation tool would be best to use or if i  
>>> should
>>> go with something else. Does someone have a suggestion? Ideally
>>> something with some good documentation. It doesn't have to be
>>> sophisticated, just enough to algorithmically generate pictures. I'm
>>> planning on using Gnome 2 as well, if this makes a difference.
>> Cairo can make nice figures and there are Ruby bindings. The  
>> bindings have little (no?) documentation, but Cairo itself is very  
>> well documented and there are good docs for the Python bindings  
>> which are almost identical.
>> I'd post links, but Google is your friend really.
>> Alex Gutteridge
>> Bioinformatics Center
>> Kyoto University
> I've seen quite a few Petri net animations on the web -- perhaps  
> you could grab one of those and just do the Ruby scripting.
>
You could do it with RMagick, it is the Ruby lib for ImageMagick. It  
can handle vector art and raster art. It has quite good documentation  
too. Not sure about animation or interactivity, but you could do that  
using one of the game oriented libs like Gosu or Ruby/SDL or RubyGame.

In the end though, Javascript might be a lot easier to just program  
an animation, you could then simply use any HTML view for display  
(web browser). That said, you might look into Scriptaculous or  
Prototype, the Ruby bound Javascript libraries that are commonly used  
in Ruby on Rails for eyecandy.