1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

NodeBox 1.9.1

Posted by Frederik on Oct 02, 2007

Hi folks!

We're very proud to release NodeBox 1.9.1 today. Amongst the new features are:

* Export types: export the output of your script to PDF, PNG, TIFF, JPEG or GIF.
* Console running: run NodeBox scripts from the console or from any other Python application. Read http://nodebox.net/code/index.php/Console for all the details.
* Clipping: a new clipping implementation that fixes all the bugs.
* The canvas: access all of your drawing through the canvas; the canvas is now a variable in your NodeBox script, that you can use to list all objects on it, or even save or clear it. Here's an example:
for i in range(100):
    rect(random(WIDTH), random(HEIGHT), 20, 20)
canvas.save("manyrects.png")
canvas.clear()
The "save" command saves the canvas as it is at that point (again, "save" supports pdf, png, tiff, jpeg or gif -- we use this method ourselves internally). The clear command clears out the entire canvas, and you'll end up with an empty canvas.

* Keyword arguments for setting color and fonts. These leave the state intact, so you can quickly
throw an in-between object that has a different fill or stroke than what you're working with.
rect(0, 0, 100, 100, fill=(.2, 0.3, 0.5), stroke=0, strokewidth=10) 
text("hello", 300, 400, fontsize=72, font="Helvetica-Bold")
* Change graphic objects ("grobs") attributes later on:
myrect = rect(0, 0, 100, 100) 
myrect.rotate(200) 
myrect.fill = 0.8, 0.2, 0.3 
 
mytext = text("hello", 300, 300) 
mytext.scale(2.0) 
mytext.font = "Helvetica-Bold"
* Colors now output correct RGB values. If you'd rather have CMYK, use the outputmode command at the top of your script:
outputmode(CMYK)
Additional changes are available in the Changes.txt that comes with NodeBox.