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

Paths commands

Posted by Sisra on Nov 15, 2007

Hi NodeBoxers!

I'm having trouble retrieving paths commands. I'm runing NodeBox 1.0rc7 and getting this error:
AttributeError: 'BezierPath' object has no attribute 'point'

The error is for the Paths Mathematics tutorial script:

nofill()
autoclosepath(close=False)
beginpath(100,100)
curveto(150, 100, 200, 150, 150, 200)
curveto(50, 250, 200, 350, 400, 400)
path = endpath()
 
for t in range(11):
    pt = path.point(0.1*t) 
    oval(pt.x-2, pt.y-2, 4, 4)
I've tried importing the bezier library
bezier = ximport("bezier")
and another eror is returned:
ImportError: No module named bezier

What's wrong with this?
Thanks in advance


 
Posted by fdb on Nov 15, 2007

Hi,

The bezier library was integrated in NodeBox version 1.84. Since you use an old version, this is not working yet.

Instead, you should use the bezier library, like you said. However, it seems you haven't installed it yet. You can download the library here: http://nodebox.net/code/index.php/Bezier

Try the examples in the folder, and put your own scripts in the same folder (or just copy the bezier.py file to any folder you want).

Kind regards,

Frederik