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

Colors PDF bug

Posted by anonymous on May 12, 2008

NodeBox seems to crash every time I use gradient fills and shadows from the colors library, then export to PDF. Here is some sample code.

colors = ximport("colors")
size(360, 180)
colors.gradientfill(rect(0, 0, WIDTH, HEIGHT, draw=False), color(0.5, 0, 0), color(0.95, 0.9, 0.8))
font("Baskerville", 216)
txt = text("B", 0, HEIGHT-10, draw=False)
path = txt.path
fontsize(96)
for part in textpath("LAH", txt.metrics[0], txt.y): path.append(part)
colors.shadow(dx=2, dy=2, alpha=0.5)
colors.gradientfill(path, color(0.5, 0.25, 0), color(1, 0.75, 0), type="linear", spread=1.5)
colors.noshadow()
stroke(0.5, 0, 0)
nofill()
drawpath(path)


 
Posted by Tom De Smedt on May 14, 2008

This is a known issue. However, so far I haven't been able to recreate the bug. It would help me if you could try out the following things:

- Does export work without shadows and gradients?
- Does export work with only shadows applied?
- Does export work with only gradients applied?
- Can you send me your system specifications (machine/OS/graphics card) and the output in the Console application after the crash?

Thanks



Posted by anonymous on May 14, 2008

Here's the console output:

NodeBox(2631,0xa01d7fa0) malloc: *** mmap(size=3758100480) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
NodeBox(2631,0xa01d7fa0) malloc: *** mmap(size=3758100480) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

I'm using Mac OS X 10.5.2 with a 2.4 GHz Inter Core 2 Duo processor. I also tried only the first three lines of code, but it resulted in the exact same error. I seem to remember that I could indeed make a PDF with shadows alone, however, so the problem must be with the gradient fills.
BTW, what's the difference between the gradientfill and gradientpath functions?