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

Too complex for Illustrator?

Posted by Russell on Jan 17, 2007

Hey there, I've got a fairly simple script running making a whole bunch of circles, and when I export it, Illustrator won't open the files properly - the circles all come up filled, not stroked - BUT - if I open the SAME PDFs in Apple Preview, they're perfect.

Any ideas.

Here's the little script I'm running:

size(820,310)
colormode(CMYK)
fill(0,0,0,0)
rect(0,0,WIDTH,HEIGHT)
nofill()
 
for i in range(5000):
	stroke(random(),0,0,0,1)
	s = random(10)
	strokewidth(random(100))
	oval(random(-100,(WIDTH)), random(HEIGHT), s, s)
 
for i in range(20):
	stroke(0,0,0,0,random(.7,1))
	s = random(40)
	strokewidth(random(100))
	oval(random(600,500), random(100,200), s, s)
 
fill(1,0,0,0,1)
font('Delicious-Roman')
text('a+b', random(520,580), random(150,180))


Any help would be mega-appreciated.



Posted by Russell on Jan 18, 2007

OK - so it can't be to complex, I've tried doing it with like 2 circles, still no good.

Any ideas please share them.



Posted by Tom De Smedt on Jan 19, 2007

Hi Russell,

It took me a while to figure this one out :-)
The thing is: the ovals in your script have a maximum diameter of 10 while their stroke width can be up to a 100 thick. When the stroke width exceeds the diameter, NodeBox starts expanding the diameter instead of the stroke width.

Take a look at this example:
http://nodebox.net/code/data/media/stroke_bigger_than_diameter.mov

Illustrator on the other hand draws circles with a max diameter of 10. It's normal for Preview to render the same output as NodeBox, they both use the same Mac OS X technology. Not so for Illustrator.

I'm not sure if this is a bug or not - who is doing it right, NodeBox or Illustrator. I'm going to have a chat with Frederik.



Posted by Russell on Jan 20, 2007

So would a temporary solution be to randomize the diameter more and the strokewidth less?



Posted by Tom De Smedt on Jan 20, 2007

Yes, the ovals in your scripts look diameter 20-200-ish and strokewidth 0.25-20.0-ish.



Posted by J0hnd0e on Jan 13, 2011

Tom

How do you indent the value in the video?