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

compound paths crashing Nodebox

Posted by Pontus Forsberg on May 15, 2012

(Not sure my previous post got through)
I'm having trouble with Nodebox unexpectedly quitting quite often. It seems to be related to using compound paths. For example, this code will do it usually more than one time in ten:

H=300.0
W=300.0
size(W,H)
d=random(WIDTH/6)
c=oval(random(WIDTH),random(HEIGHT),d,d,draw=False)
 
for i in range(50):
    d=random(WIDTH/6)
    o=oval(random(WIDTH),random(HEIGHT),d,d,draw=False)
    c=c.union(o)
nofill()
stroke(0)
drawpath(c)
I've tried it on two different macs, both running 10.6.8, but with very different hardware (an older mac pro and a newer macbook pro). It doesn't seem to me to be a memory issue.

Has anybody else had this problem?


 
Posted by Karsten on May 15, 2012

No problems here on an old PPC 10.4 machine. Even after setting the range to 1000.

Maybe it's a system problem. You should have gotten a crash report that tells you where it crashed.



Posted by Lucas on May 15, 2012

Which version of NB are you running? I ran your code on Lion with 1.9.7rc1 with no problem on any range and multiple times.



Posted by Pontus on May 16, 2012

Thank you both for testing it. I'm using NB 1.9.5.
I've been trying to make sense of the crash reports. I have no experience with such, but by reading this: https://developer.apple.com/library/mac/#technotes/tn2004/tn2123.html, I've gotten as far as
the exception was caused by a memory access instruction (in terms of C, this means that you're dereferencing an invalid pointer).
Which tells me pretty much nothing ;). I'll just put the thing on the shelf until I've updated my system.
Thanks again.