ano.malo.us pretty typical actually..

Nodebox

Nodebox is a Mac/Python app for programatically creating graphics and animation, like Processing but with less power but also much simpler to use. I’m currently working on a webapp, Bubble (Bayesian User-Based Biological Learning Environment, natch) that’s written entirely in python. The actual bayesian learning happens using PEBL (Python Environment for Bayesian Learning (see a trend here?)) and the web interface and database are created using the python web framework, Turbogears. So, rather than introducing Photoshop into this all-python party, I decided to create the logo for Bubble using NodeBox. This is the initial draft:

Bubble logo, 1st draft

And it’s created using this script:

size(800, 400)
fill(0)
rect(0,0,WIDTH,HEIGHT)
from math import sin, cos, tan, log10
 
cX = 1
cY = 3.9
x1 = x2 = 100
y1 = y2 = 20
 
helix1 = []
helix2 = []
 
GENE, BINARY = 1,-1
 
for i in range(128):
    x1 += cos(cY)*8
    y1 += log10(cX)*random(2.0,2.2) + sin(cX) * 1
    s1 = 12 + cos(cX)*6    
    helix1.append((x1,y1,s1))
 
    x2 += sin(cY + 60)*8
    y2 += log10(cX)*random(2.0,2.2) + cos(cX) * 1
    s2 = 12 + sin(cX-45)*6
    helix2.append((x2,y2,s2))
 
    cX += .2
    cY += random(.145, .17)
 
def draw(x,y,s,c):
    fill(random(), 0.8, 0.9*c, random(.15,.3))
    oval(x-s/2, y-s/2, s, s*1.2)
    fill(random(), 0.8, 0.9*c, random(.8,.9))
    fontsize(s)
    if c is GENE:
        text(choice(['A', 'G', 'C', 'T']), x-s/2,y+s/2.5)
    elif c is BINARY:
        text(choice(['0', '1']), x-s/2.5, y+s/2.5)
 
 
for i,(h1,h2) in enumerate(zip(helix1,helix2)):
    if i < 20: continue
 
    x1,y1,s1 = h1
    x2,y2,s2 = h2
 
    if (i-20)%20 < 10 and (i-20)%20 > 2:
        draw(x1,y1,s1, GENE)
        draw(x2,y2,s2, BINARY)
    else:
        draw(x2,y2,s2, BINARY)
        draw(x1,y1,s1, GENE)
 
fontsize(150)
font("Chalkboard")
path = textpath("Bubble", 220, 280)
beginclip(path)
for i in range(1500):
    fill(random(), 0.8, 0.9, random(.3, .6))
    x = random(220,800)
    y = random(100,300)
    oval(x,y, random(10,20), random(10,20))
endclip()

2 Comments

Posted by
retardita
Mar 26, 2007 @ 12pm

By far the best method to produce a logo I’ve seen so far! (For geeky stuff like this anyway…)


[...] making possible all kinds of visualization. I haven’t used Processing before but have experimented with NodeBox and since the data files are simple text files, I had no problems writing a quick [...]


Leave a Comment

Verizon Bucca Di Beppe means “Lots of food”