User:Danny van der Kleij/Phillips Turtle

From XPUB & Lens-Based wiki
< User:Danny van der Kleij
Revision as of 02:21, 14 June 2011 by Danny van der Kleij (talk | contribs) (Created page with "I wanted to reconstruct(sticking with the theme) [http://en.wikipedia.org/wiki/Philips_Pavilion Phillips Pavilion] by [http://en.wikipedia.org/wiki/Le_Corbusier Le Corbusier] and...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I wanted to reconstruct(sticking with the theme) Phillips Pavilion by Le Corbusier and Iannis Xenakis, in Inkscape and with Turtlegraphics.

I thought it would be somewhat easy since the pavilion is conscructed with 9 Hyperbolic Paraboloids

but after a lot of trial and error I did not get very far.


def parallel(length, tilt, color):
  pd() 
  styles['fill'] = rgb(0, 0, color) 
  for i in range(2):
    fd(length)
    rt(90 - tilt)
    fd(length)
    rt(90 + tilt)
  pu()    
  fd(length)

def line(length, tilt, amount):
  for i in range(amount):
    parallel(length, tilt - i, 0 + (i* 4))
   

def block(length, tilt, amount, rows):
  for i in range(rows):
    line(length, tilt, amount)
    rt(90 - tilt )
    fd(length)
    rt(90 + tilt )
    fd(length * (amount + 1))
    rt(180 - 1)

block(10, 50, 60, 10)


  
def line(length):
  pd()
  fd(length)
  pu()
  
def grid(length, amount):
  for i in range(amount):
    line(length)
    rt(90+i)
    fd(10)
    rt(90+i)
    line(length)
    lt(90-i)
    fd(10)
    lt(90-i)

grid(100, 10)