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

Some bugs

Posted by Karsten Wolf on Jun 28, 2009

Hi,

a few bugs...

#1
- Nodebox scripts can't have an encoding line

This is annoying if you need utf-8 encoding for your comments and you want to use the scripts in other python environments.

This can be fixed in

nodebox/src/nodebox/gui/mac/__init__.py

in method _compileScript of class NodeBoxDocument by inserting

source = source.encode("utf-8")

after line 2



#2
- drawpath with a recorded path can only be drawn once

to demo this:

# define a path to be re-played
beginpath(0,0)
lineto(100,0)
p = endpath(draw=False)
 
transform(CORNER)
translate(100,100)
strokewidth(1)
# draw some red lines
# and paint over them with drawpath()
# with color black
# 
# result should be 3 black lines
# but only the first is drawn
 
for i in range(3):
    rotate(360 / 3.0)
 
    # paint a regular line
    stroke(1,0,0)
    line(0,0, 100, 0)
 
    # paint over with a recorded 
    stroke(0,0,0)
    drawpath(p)
#3
- in current svn repository textpath doesn't work; it complains about wrong number of arguments

#4
- the creator code for NodeBox is 'ndbx'. Apple reserves all lowercase creators for themselves. Something like NdBx would be more appropriate


A few notes...

- The NodeBox Icon hack in macbuild.sh
This can be avoided by adding the iconresource in macsetup.py in the proper (or at least working) way:

Add this line after the "optimize = 2," option

iconfile = 'Resources/NodeBox.icns',


Keep up the excellent work! Even though I'm complaining NodeBox made me learn Python. Thank you.

-karsten


 
Posted by fdb on Jun 29, 2009

Hi,

Thanks for the remarks. We're planning on doing a maintenance release for NodeBox 1, and I'll make sure these fixes are in there.

Frederik