User:Natasa Siencnik/prototyping/turtle: Difference between revisions

From XPUB & Lens-Based wiki
Line 301: Line 301:
=====SVG-File=====
=====SVG-File=====
<source lang="python">
<source lang="python">
#building WALL
def wall(l, s):
pd()
fd(l)
lt(90)
fd(s)
lt(90)
fd(l)
rt(90)
pu()
#building SKYSCRAPER
def skyscraper():
for i in range(4):
pd()
styles['fill'] = rgb(0, 0, 0)
wall(50, 20)
pu()
#building GARDEN
def garden():
for i in range(4):
pd()
fd(140)
lt(90)
pu()
#changing position for building garden
def position_garden():
pu()
fd(60)
rt(90)
fd(60)
rt(90)
rt(90)
pd()
#changing position for building skyscraper
def position_skyscraper():
pu()
fd(60)
rt(90)
fd(95)
pd()
#building group of skyscrapers with garden
def row(howmany):
for i in range(howmany):
skyscraper()
position_garden()
garden()
position_skyscraper()
#building the RADIANT CITY
def city(howmany):
for i in range(howmany):
row(3)
city(1)
</source>
</source>



Revision as of 20:20, 8 June 2011


The Radiant City

TURTLE GRAPHICS WITH LE CORBUSIER

Concept

Corbusier City 03.jpg
Le Corbusier Radiant City Model

Corbusier City 01.jpg

For a number of years French officials had been unsuccessful in dealing with the squalor of the growing Parisian slums, and Le Corbusier sought efficient ways to house large numbers of people in response to the urban housing crisis. He believed that his new, modern architectural forms would provide a new organizational solution that would raise the quality of life for the lower classes. His Immeubles Villas (1922) was such a project that called for large blocks of cell-like individual apartments stacked one on top of the other, with plans that included a living room, bedrooms and kitchen, as well as a garden terrace.

Not merely content with designs for a few housing blocks, soon Le Corbusier moved into studies for entire cities. In 1922, he presented his scheme for a "Contemporary City" for three million inhabitants (Ville Contemporaine). The centerpiece of this plan was the group of sixty-story, cruciform skyscrapers; steel-framed office buildings encased in huge curtain walls of glass. These skyscrapers were set within large, rectangular park-like green spaces. At the center was a huge transportation hub, that on different levels included depots for buses and trains, as well as highway intersections, and at the top, an airport. He had the fanciful notion that commercial airliners would land between the huge skyscrapers. Le Corbusier segregated pedestrian circulation paths from the roadways and glorified the use of the automobile as a means of transportation. As one moved out from the central skyscrapers, smaller low-story, zigzag apartment blocks (set far back from the street amid green space), housed the inhabitants. Le Corbusier hoped that politically-minded industrialists in France would lead the way with their efficient Taylorist and Fordist strategies adopted from American industrial models to reorganize society. As Norma Evenson has put it, "the proposed city appeared to some an audacious and compelling vision of a brave new world, and to others a frigid megalomaniacally scaled negation of the familiar urban ambient."

In the 1930s, Le Corbusier expanded and reformulated his ideas on urbanism, eventually publishing them in La Ville radieuse (The Radiant City) of 1935. Perhaps the most significant difference between the Contemporary City and the Radiant City is that the latter abandons the class-based stratification of the former; housing is now assigned according to family size, not economic position.[7] Some have read dark overtones into The Radiant City: from the "astonishingly beautiful assemblage of buildings" that was Stockholm, for example, Le Corbusier saw only “frightening chaos and saddening monotony.”[1] He dreamed of "cleaning and purging" the city, bringing "a calm and powerful architecture"—referring to steel, plate glass, and reinforced concrete. Though Le Corbusier's designs for Stockholm did not succeed, later architects took his ideas and partly "destroyed" the city with them.

For full text see Wikipedia [[1]]

Scripting Progress

Python : Script radiant_city.py Step #1
from TurtleWorld import *

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.01

print bob

#cruciform skyscraper
fd(bob, 50)
lt(bob)
fd(bob, 20)
lt(bob)
fd(bob, 50)
rt(bob)
fd(bob, 50)
lt(bob)
fd(bob, 20)
lt(bob)
fd(bob, 50)
rt(bob)
fd(bob, 50)
lt(bob)
fd(bob, 20)
lt(bob)
fd(bob, 50)
rt(bob)
fd(bob, 50)
lt(bob)
fd(bob, 20)
lt(bob)
fd(bob, 50)
rt(bob)

wait_for_user()
Python : Script radiant_city.py Step #2
from TurtleWorld import *
import random

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.01

print bob

#building WALL
#l for long wall
#s for short wall
def wall(l, s):
	fd(bob, l)
	lt(bob)
	fd(bob, s)
	lt(bob)
	fd(bob, l)
	rt(bob)

#building SKYSCRAPER
for i in range(4):
	wall(50, 20)

#wait_for_user()

Screenshot 20110608-1.png

Python : Script radiant_city.py Step #3
from TurtleWorld import *

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.01

print bob

#building WALL
#l for long wall
#s for short wall
def wall(l, s):
	fd(bob, l)
	lt(bob)
	fd(bob, s)
	lt(bob)
	fd(bob, l)
	rt(bob)

#building SKYSCRAPER
def skyscraper():
	for i in range(4):
		wall(50, 20)

#building GARDEN
def garden():
	for i in range(4):
		fd(bob, 140)
		lt(bob)

#changing position for building garden()
def position_garden():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 60)
	rt(bob)
	rt(bob)
	pd(bob)

#changing position for building skyscraper()
def position_skyscraper():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 95)
	pd(bob)

#building GROUP OF SKYSCRAPERS with GARDEN
def row(howmany):
	for i in range(howmany):
		skyscraper()
		position_garden()
		garden()
		position_skyscraper()
 
row(3)

#wait_for_user()

Screenshot 20110608-2.png

Python : Script radiant_city.py Step #4
from TurtleWorld import *

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.01

print bob

#building WALL
#l for long wall
#s for short wall
def wall(l, s):
	fd(bob, l)
	lt(bob)
	fd(bob, s)
	lt(bob)
	fd(bob, l)
	rt(bob)

#building SKYSCRAPER
def skyscraper():
	for i in range(4):
		wall(50, 20)

#building GARDEN
def garden():
	for i in range(4):
		fd(bob, 140)
		lt(bob)

#changing position for building garden()
def position_garden():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 60)
	rt(bob)
	rt(bob)
	pd(bob)

#changing position for building skyscraper()
def position_skyscraper():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 95)
	pd(bob)

#building GROUP OF SKYSCRAPERS with GARDEN
def row(howmany):
	for i in range(howmany):
		skyscraper()
		position_garden()
		garden()
		position_skyscraper()
 
row(3)

#wait_for_user()

Screenshot 20110608-3.png

Python : Script radiant_city.py Step #5
from TurtleWorld import *

world = TurtleWorld()
bob = Turtle()
bob.delay = 0.01

print bob

#building WALL
#l for long wall
#s for short wall
def wall(l, s):
	fd(bob, l)
	lt(bob)
	fd(bob, s)
	lt(bob)
	fd(bob, l)
	rt(bob)

#building SKYSCRAPER
def skyscraper():
	for i in range(4):
		wall(50, 20)

#building GARDEN
def garden():
	for i in range(4):
		fd(bob, 140)
		lt(bob)

#changing position for building garden
def position_garden():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 60)
	rt(bob)
	rt(bob)
	pd(bob)

#changing position for building skyscraper
def position_skyscraper():
	pu(bob)
	fd(bob, 60)
	rt(bob)
	fd(bob, 95)
	pd(bob)

#building group of skyscrapers with garden
def row(howmany):
	for i in range(howmany):
		skyscraper()
		position_garden()
		garden()
		position_skyscraper()

#changing position for next row
#i know that this is not the right way to do this :(
def position_row():
	pu(bob)
	bk(bob, 465)
	rt(bob)
	fd(bob, 155)
	lt(bob)
	pd(bob)

#building the RADIANT CITY
def city(howmany):
	for i in range(howmany):
		row(3)
		position_row()

city(3)

wait_for_user()

Screenshot 20110608-4.png

SVG-File
#building WALL
def wall(l, s):
	pd()
	fd(l)
	lt(90)
	fd(s)
	lt(90)
	fd(l)
	rt(90)
	pu()

#building SKYSCRAPER
def skyscraper():
	for i in range(4):
		pd()
		styles['fill'] = rgb(0, 0, 0)
		wall(50, 20)
		pu()

#building GARDEN
def garden():
	for i in range(4):
		pd()
		fd(140)
		lt(90)
		pu()

#changing position for building garden
def position_garden():
	pu()
	fd(60)
	rt(90)
	fd(60)
	rt(90)
	rt(90)
	pd()

#changing position for building skyscraper
def position_skyscraper():
	pu()
	fd(60)
	rt(90)
	fd(95)
	pd()

#building group of skyscrapers with garden
def row(howmany):
	for i in range(howmany):
		skyscraper()
		position_garden()
		garden()
		position_skyscraper()

#building the RADIANT CITY
def city(howmany):
	for i in range(howmany):
		row(3)

city(1)

Useful Links

http://pzwart3.wdka.hro.nl/wiki/Turtle_Graphics
http://pzwart3.wdka.hro.nl/wiki/Vector_graphics
http://en.wikipedia.org/wiki/Le_Corbusier