ETH Zuerich - Startseite
Professur für CAAD

 


caad d-arch


Caad Teaching
 

 
Bachelor of Architecture: CAAD II ss07

 
Master of Advanced Studies
in Architecture, CAAD


 
DWF-Processing
Programmieren statt Zeichnen


 
Graustufen - Ein Atlas
Schweizer Wohngebäude als XML Daten


 
DWF- Denken in Systemen:
In Collaboration with the Technical University Vienna


 
Seminarwoche:
BlowUp


 
Archiv

 
Caad Projects
 

 
Theory
 
Design
 
Building
 
Practice

 
Related pages
 

 
Swiss Federal Institute of Technology Zurich
 
Institute of Building Technology
 
Faculty of Architecture

 
Other pages

 










hbt d-arch

MAS ETH ARCH/CAAD - 2005/06 - STUDENT PAGES
Master of Advanced Studies in Architecture, Specialization in Computer Aided Architectural Design | 065-0005/6
Supervision: Prof. Dr. Ludger Hovestadt, Philipp Schaerer
Chair of CAAD, ETH Zurich





pattern| pattern rules | script + screen shots| 3D + 2D printer |


togetherpresentopti.giftogetherpresentopti.gif

PROCEDURE towerBable;
 
TYPE

   STEMPORTION = STRUCTURE
      width, heigth, rotangel, radius,diameter: REAL;
      startpos, endpos : POINT;
      pangelrot,pheigth,pradius: REAL;
      numberofparts: INTEGER;
      widthbotleg,widthtopleg: REAL;
   END;
   
VAR
   myAxisstartPoint:       POINT;
   myAxisendPoint:          POINT;
   PortDim:             ARRAY [1..25] OF STEMPORTION;
   k,i,n,t,s, counter, portionWidth, portionHeigth:    INTEGER;
   rotAngel:            REAL;
   myCircle,MyBase,MyLegs:      HANDLE;
   pX,pY,pZ:            REAL;
   r,g,b,colorRange:         LONGINT;
   newdrawingheigth:         REAL;
   
   str : String;

BEGIN;

   myAxisstartPoint.x:=    0;
   myAxisstartPoint.y:=    0;   
   myAxisendPoint.x:= 0;
   myAxisendPoint.y:= 200;
   counter:=          1;
   portionWidth:=      400;
   portionHeigth:=      600;

{######    SETTING THE DATA    #####}

      {#### CALCULATE DE VALUES OF PORTION VARIABLES#####}

      PortDim[counter].width:= portionWidth;
      PortDim[counter].heigth:= portionHeigth;
      PortDim[counter].rotangel:= 8*random;
      PortDim[counter].radius:= PortDim[counter].width/2;
      PortDim[counter].diameter:= (2*PI*PortDim[counter].radius);
      
      {#### CALCULATE DE VALUES OF PART VARIABLES#####}   
   
      PortDim[counter].pradius:= PortDim[counter].radius/6;
      PortDim[counter].pheigth:= PortDim[counter].heigth+0.05;
      PortDim[counter].numberofparts:= TRUNC(PortDim[counter].diameter/(PortDim[counter].pradius*2));
      PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;
      PortDim[counter].widthbotleg:= PortDim[counter].pradius;
      PortDim[counter].widthtopleg:= PortDim[counter].pradius-10;

      counter:= counter+1; 

      FOR i:= 2 TO 20 DO BEGIN

         
         CASE i OF
            2,4,6,8,10,12,14,16,18,20: PortDim[counter].rotangel:=-5*random;
            3,5,7,9,11,13,15,17,19:PortDim[counter].rotangel:=5*random;
         END;

         IF i <= 14 THEN BEGIN
            PortDim[counter].width:= PortDim[counter-1].width*0.95;
            PortDim[counter].heigth:= PortDim[counter-1].heigth * 0.8;
            PortDim[counter].radius:= PortDim[counter].width/2;
            PortDim[counter].diameter:= (2*PI*PortDim[counter].radius);
         END;

         IF i > 14 THEN BEGIN
            IF i <= 16 THEN BEGIN
               PortDim[counter].width:= PortDim[counter-1].width*1.1;
               PortDim[counter].heigth:= PortDim[counter-1].heigth * 1.1;
               PortDim[counter].radius:= PortDim[counter].width/2;
               PortDim[counter].diameter:= (2*PI*PortDim[counter].radius);
            END;
         END;
         IF i > 16 THEN BEGIN
            PortDim[counter].width:= PortDim[counter-1].width*0.7;
            PortDim[counter].heigth:= PortDim[counter-1].heigth * 0.8;
            PortDim[counter].radius:= PortDim[counter].width/2;
            PortDim[counter].diameter:= (2*PI*PortDim[counter].radius);
         END;
         
         
         {#### CALCULATE DE VALUES OF PART VARIABLES#####}
            IF (PortDim[counter].width>=portionWidth*.75) THEN BEGIN
               
               PortDim[counter].pradius:= PortDim[counter].radius/6;
               PortDim[counter].pheigth:= PortDim[counter].heigth+0.05;
               PortDim[counter].numberofparts:= TRUNC(PortDim[counter].diameter/(PortDim[counter].pradius*2));
               PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;
               PortDim[counter].widthbotleg:= PortDim[counter].pradius;
               PortDim[counter].widthtopleg:= PortDim[counter].pradius-10;   
            END
            ELSE    IF (PortDim[counter].width>=portionWidth*0.50) THEN BEGIN
                  
                     PortDim[counter].pradius:= PortDim[counter].radius/6;
                     PortDim[counter].pheigth:= PortDim[counter].heigth+0.05;
                     PortDim[counter].numberofparts:= TRUNC(PortDim[counter].diameter/(PortDim[counter].pradius*2));
                     PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;
                     PortDim[counter].widthbotleg:= PortDim[counter].pradius;
                     PortDim[counter].widthtopleg:= PortDim[counter].pradius-8;
                  END
                  ELSE   IF (PortDim[counter].width>=portionWidth*0.33) THEN BEGIN
               
                           PortDim[counter].pradius:= PortDim[counter].radius/7;
                           PortDim[counter].pheigth:= PortDim[counter].heigth+0.05;
                           PortDim[counter].numberofparts:= TRUNC(PortDim[counter].diameter/(PortDim[counter].pradius*2));
                           PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;   
                           PortDim[counter].widthbotleg:= PortDim[counter].pradius/3;
                           PortDim[counter].widthtopleg:= (PortDim[counter].pradius/3)-5;
                        END
                        ELSE    IF(PortDim[counter].width>=portionWidth*0.11) THEN BEGIN
                           FOR i:=13 TO 16 DO BEGIN
                              PortDim[counter].pradius:= PortDim[counter].radius/8;
                              PortDim[counter].pheigth:= 1.1;
                              PortDim[counter].numberofparts:= 2;
                              PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;   
                              PortDim[counter].widthbotleg:= PortDim[counter].pradius/4;
                              PortDim[counter].widthtopleg:= (PortDim[counter].pradius/4)-3;
                           END;
               
                           FOR i:=17 TO 19 DO BEGIN
                              PortDim[counter].pradius:= PortDim[counter].radius/9;
                              PortDim[counter].heigth:= 2+random;
                              PortDim[counter].numberofparts:= 2;
                              PortDim[counter].pangelrot:=360/PortDim[counter].numberofparts;   
                              PortDim[counter].widthbotleg:= PortDim[counter].pradius/3;
                              PortDim[counter].widthtopleg:= (PortDim[counter].pradius/3)-3;
                           END;
                        END;


            IF (PortDim[counter].heigth<=1) THEN BEGIN
               counter:=19;
            END;
            
            counter:= counter+1;

            rotAngel:=PortDim[counter].rotangel;

         
      END;

   
      {#### DRAWS DE VALUES OF PORTION AND AXIS#####}

str:= 'PortDim[k].numberofparts: ';
newdrawingheigth:= 0;
FOR k:=1 TO 10 DO BEGIN
   str:= concat(str, ' -k=',k,': ', PortDim[k].numberofparts);
   message(str);
   FOR t:= 0 TO PortDim[k].numberofparts DO BEGIN
      BeginGroup;
         ClosePoly;   
         ColorIndexToRGB(121,r,g,b);
         FillBack(r,g,b);   
         BeginMXtrd (newdrawingheigth * 0.9,newdrawingheigth +PortDim[k].heigth);
            BeginPoly;       (*** draws the bottom part of the leg***)
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-30,0);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-30,PortDim[k].widthbotleg/2);
                  CurveTo(myAxisstartPoint.x+PortDim[k].radius,50);
                  CurveTo(myAxisstartPoint.x+PortDim[k].radius,-50);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-30,-PortDim[k].widthbotleg/2);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-30,0);
            EndPoly;
            BeginPoly;    (*** draws the top part of the leg***)
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-10,0);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-10,PortDim[k].widthtopleg/2);
                  CurveTo(myAxisstartPoint.x+PortDim[k].radius,30);
                  CurveTo(myAxisstartPoint.x+PortDim[k].radius,-30);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-10,-PortDim[k].widthtopleg/2);
                  LineTo(myAxisstartPoint.x+PortDim[k].radius-10,0);
            EndPoly;
         EndMXtrd;
         
         Rotate3D(0,0,PortDim[k].pangelrot*t);
         Rotate(PortDim[k].rotangel);
         ColorIndexToRGB(41,r,g,b);
         FillBack(r,g,b);
         ColorIndexToRGB(255,r,g,b);
         PenFore(r,g,b);

         {### Doonut ###}
         BeginSweep(   0,360,10,0);
            ArcByCenter(myAxisstartPoint.x+PortDim[k].radius-0.002,0,PortDim[k].pradius,90,360);   
         EndSweep;

         Rotate3D(0,0,PortDim[k].pangelrot*t);
         Move3D(0,0,newdrawingheigth +PortDim[k].heigth);
         Rotate(PortDim[k].rotangel);
         ColorIndexToRGB(255,r,g,b);
         PenFore(r,g,b);
         DSelectAll;   
      EndGroup;
      
   END;
   newdrawingheigth:= newdrawingheigth+PortDim[k].heigth;
END;


END;

Run (towerBable);
vector script TowerofBabel.mcd:

-- NDSYaelGirotIfrah - 10 Dec 2005

Revision r1.6 - 15 Dec 2005 - 09:03 - NDSYaelGirotIfrah
Parents: WebHome > NDSYaelGirotIfrah
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

This website has been archived and is no longer maintained.