City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

13
City of communication

description

Instructor: 畢光建, 王識源(Shih-Yuan Wang) Student: 黃馨瑩,柯宜良,何奕均,蔡友皓,賴冠廷,周治平,周東諭,盛郁庭,吳培元,賴國睿,詹為淳,陳佳筠,蘇奕馨

Transcript of City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

Page 1: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

City of communication

Page 2: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

ABSTRACT

The main idea of that studio, Proto-Architecture, needs to focus on developing the strategy for the urban design via digital tool, Processing, an open source platform for writing computational drawings.

everywhere. Therefore, the project is trying to employ Processing with mathematic way to optimize the base station in the city of high density.

Page 3: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

RESEARCH

Page 4: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

h(M)

deg = 8

deg =

<= 1500(M)

deg = 120

Area(A)

Page 5: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

no signal at this areais that circles need to be increased the radius and then the second step is empolyed voronoi to distribute the boundary of signal service

the third step is to generate voronoi pattern

Page 6: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio
Page 7: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio
Page 8: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio
Page 9: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

METHOD

Page 10: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

(1) random agents with certain amount (2) circle packing with certain distance

(3) generating the height of building (4) generating attractors for attracting agents

Page 11: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

(5) circle packing (6) searching the hightest agents

(7) generating voronoi pattern (8) optimizing the best solution for the base station

Page 12: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio
Page 13: City Of Communication | 2011 PROTO-ARCHITECTURE | TKU 4th Design Studio

AGENT

void  display()

void  checkBorder()

ATTRACTORvoid  display(){

void  checkBorder(){

CONEvoid  cone(float  x,  float  y,  float  r,  float  h)  {

void  coneDetail(int  det)  {

 void  checkBorder(){

MANAGE  void  createAgent(int  num){

void  createAttractor(){

void  displayAtt(){

void  displayAgent(){

void  removePO(int  id){

void  displayCone(){

void  checkIntersection01(){

 void  checkHeight(){

void  renderPointVeLine(){

void  displayVoronio(){

void  countPolygonPoint(){

void  countInnerPoint(){

REG  POINT

 void  display(){

VO  POINTvoid  display(){

MAINvoid  setup(){

void  draw(){

void  keyPressed(){

void  gui(){

void  controlEvent(ControlEvent  theEvent){

void  run(){

Agent(Vec2D  location){  

Attractor(Vec2D  location,  Vec2D  velocity,  float  radius){

Cone(PVector  location){

voPoint(Vec2D  location){

regPoint(Vec2D  location,  float  hei){

void  checkIntersection02(){

void  countAgent(){

 

     

     

 

     

     

       

       

   

       

       

   

   

class  Agent{      ///////////////////////////////////////////////    //PROPERTIES  //////////////////////////////////////////////  Vec2D  location,  velocity;  float  radius;  float  hei;  ///////////////////////////////////////////////  //CONSTRUCTOR  ///////////////////////////////////////////////  Agent(Vec2D  location){        this.location  =  location;    velocity  =  new  Vec2D(0,0);

       }      ///////////////////////////////////////////////    //METHOD  ///////////////////////////////////////////////  void  display(){            noStroke();      noFill();      ellipse(location.x,location.y,radius,radius);      stroke(255);      strokeWeight(3);      point(location.x,location.y);                stroke(0,255,100);      strokeWeight(1.5);          }  

class  Attractor{        /////////////////////////////////////////////////////////  //PROPERTIES  /////////////////////////////////////////////////////////  Vec2D  location;    Vec2D  velocity;    float  radius;    //////////////////////////////////////////////////////////  //CONSTRUCTOR  /////////////////////////////////////////////////////////  Attractor(Vec2D  location,  Vec2D  velocity,  float  radius){            this.location  =  location;      this.velocity  =  velocity;      this.radius  =  radius;      }    ///////////////////////////////////////////////////////////  //METHOD  //////////////////////////////////////////////////////////  void  display(){            stroke(255);      noFill();      ellipse(location.x,  location.y,  radius,  radius);      stroke(255);      strokeWeight(2);      point(location.x,  location.y);        }    void  run(){        location.add(velocity);        }  void  checkBorder(){          if  ((location.x  <  0)  ||  (location.x  >  width)){                velocity.x  =  velocity.x*-­‐1;          }        if  ((location.y  <  0)  ||  (location.y  >  height)){              velocity.y  =  velocity.y*-­‐1;            }                }      }    

class  Cone{      //////////////////////////////////////////////////  //PROPERTIES  //////////////////////////////////////////////////        PVector  location;      PVector  velocity;        float  unitConeX[];    float  unitConeY[];    int  coneDetail;      //////////////////////////////////////////////////    //CONSTRUCTOR  //////////////////////////////////////////////////      Cone(PVector  location){

     this.location  =  location;      velocity  =  new  PVector(0,0,0);      coneDetail(24);    }  /////////////////////////////////////////////////  //METHOD  /////////////////////////////////////////////////      void  cone(float  x,  float  y,  float  r,  float  h)  {        pushMatrix();    translate(x,y);    scale(r,r);    beginShape(TRIANGLES);    for  (int  i  =  0;  i  <  coneDetail;  i++)  {        vertex(unitConeX[i],unitConeY[i],0.0);        vertex(unitConeX[i+1],unitConeY[i+1],0.0);        vertex(0,0,h);    }    endShape();    popMatrix();}

void  coneDetail(int  det)  {    coneDetail  =  det;    unitConeX  =  new  float[det+1];    unitConeY  =  new  float[det+1];    for  (int  i  =  0;  i  <=  det;  i++)  {        float  a1  =  TWO_PI  *  i  /  det;        unitConeX[i]  =  (float)Math.cos(a1);        unitConeY[i]  =  (float)Math.sin(a1);    }}

void  countPolygonPoint(){

     for  (Polygon2D  poly  :  voronoi.getRegions()){          for(int  i  =  0;  i  <  data.length;  i++){          /////////////////////////////////////////////////////////////          ///////////////////////////////////////////////////////////          //get  ultimate  point          ////////////////////////////////////////////////////////////          ////////////////////////////////////////////////////////////          Vec2D  pp  =  poly.getCentroid();          float  closestDistance  =  100000;          int  counter01  =  0;          for(int  j  =  0;  j  <  pointCollection.size();  j++){                            voPoint  pts  =  (voPoint)pointCollection.get(j);              Vec2D  target  =  pts.getLocation();                            float  distance  =  pp.distanceTo(target);                            if(distance  >  0  &&  distance  <  closestDistance){                                      closestDistance  =  distance;                    counter01  =  j;                              }                }                    //////////////////////////////////////          //display  previous  the  height  of  agent          //////////////////////////////////////          voPoint  closestVoPt  =  (voPoint)pointCollection.get(counter01);            }                    //////////////////////////////////////////////////////////////          //////////////////////////////////////////////////////////////          //cal  no  signal          /////////////////////////////////////////////////////////////          ////////////////////////////////////////////////////////////          for(int  m  =  0;  m  <  agentCollection.size();  m++){                              Agent  agent  =  (Agent)agentCollection.get(m);                Vec2D  loc  =  agent.getLocation();                float  locHeight  =  agent.getHei();                                boolean  checkPoint  =  poly.containsPoint(loc);                              if(checkPoint  ==  true){                                        stroke(100);                    strokeWeight(1);                    line(newTarget.x,newTarget.y,loc.x,loc.y);                                        if(loc.x  !=  newTarget.x){                    InnerPt  innerAg  =  new  InnerPt(loc);                    InnerPtCollection.add(innerAg);                                        

class  Manage{          //////////////////////////////////////////////////////////////////////    //PROPERTIES  /////////////////////////////////////////////////////////////////////  Attractor  [][]  attractor;  int  columns  =  8;  int  rows  =  8;  float  dx;  float  dy;  PFont  font01,font02;  String  []  data;  String  []  data1;  float  x;  float  y;  PVector  regionPts;  PVector  regionPtsA;  PVector  regionPtsB;    ///////////////////////////////////////////////////////////////////////    //CONSTRUCTOR  //////////////////////////////////////////////////////////////////////                attractor  =  new  Attractor[columns][rows];        font01  =  createFont("Arial-­‐BoldMT",  20);        font02  =  createFont("ArialMT",  10);

 }    //////////////////////////////////////////////////////////////////////  //METHOD  ///////////////////////////////////////////////////////////////////////    void  createAgent(int  num){            for(int  i  =  0;  i  <  num;  i++){                  Agent  agent  =  new  Agent(new  Vec2D(random(width),  random(height)));        float  rd  =  random(2,80);              }    }    void  createAttractor(){                    }  void  displayAtt(){            for(int  i  =  0;  i  <  attractorCollection.size();  i++)  {                                  }            }  void  displayAgent(){  }    void  displayCone(){                co.cone(  c.x  ,  c.y  ,  distance  ,  distance/tan(-­‐68))                      Agent  agA  =  (Agent)agentCollection.get(i);                  for(int  j  =  i  +  1;  j  <  agentCollection.size();  j++){                                    }              }      }  void  checkHeight(){                  for(int  i  =  0;  i  <  attractorCollection.size();  i++){          for(int  j  =  0;  j  <  agentCollection.size();  j++){            if(distance  <=  radius/2  &&  agHei  >  closestHeight){            closestHeight  =  agHei;            counter  =  j;                                }                                    }                void  renderPointVeLine(){            for(int  i  =  0;  i  <  pointCollection.size();  i++){          voPoint  pts  =  (voPoint)pointCollection.get(i);        pts.display();            }      }  void  countAgent(){  }  void  displayVoronio(){    for  (Polygon2D  poly  :  voronoi.getRegions()){    }  }//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  void  countPolygonPoint(){          for  (Polygon2D  poly  :  voronoi.getRegions()){          for(int  i  =  0;  i  <  data.length;  i++){                        

 for(int  j  =  0;  j  <  pointCollection.size();  j++){          if(distance  >  0  &&  distance  <  closestDistance){                }                }              for(int  l  =  0;  l  <  regionPtCollection.size();  l++){                        }                }                  Cone  co  =  new  Cone(new  PVector(newTarget03.x,  newTarget03.y,0));            if(closestDistance>100  &&  closestDistance<300){  co.cone(  newTarget03.x  ,  newTarget03.y  ,  closestDistance  ,  closestDistance/tan(-­‐68));  co.cone(  newTarget03.x  ,  newTarget03.y  ,  closestDistance*tan(-­‐60)  ,  closestDistance/tan(-­‐68));        }            }                regPoint  ultimatePts  =  (regPoint)regionPtCollection.get(counter02);                if(distance03  <  200){      }          }                void  countInnerPoint(){      for  (Polygon2D  poly  :  voronoi.getRegions()){                                                if(distance  >  0  &&  distance  <  closestDistance){                      }                }          for(int  i  =  0;  i  <  agentCollection.size();  i++){                }  }

}                                                                        float  distanceNewToLoc  =  newTarget.distanceTo(loc);                    float  l  =  distanceNewToLoc;                    //float  h  =  newHeight;                    float  h  =  distance03*0.4040;                    float  e  =  h*1.37;

                   float  f  =  h*2.47508;                    float  a  =  locHeight;                    float  b  =  (h*(f-­‐l))/f;                    float  c  =  (h*(e-­‐l))/e;                    float  d  =  0;                                        if(distance03  <  200){                                        ////////////////////////////////////////////////////////////////////////////////////                    //display  new  the  height  of  agent                    ////////////////////////////////////////////////////////////////////////////////////                                  stroke(0,0,255);                    strokeWeight(3);                    line(newTarget.x,newTarget.y,0,  newTarget.x,newTarget.y,h);                                          ////////////////////////////////////////////////////////////////////////////////////                    //divide  and  store  point  in  arraylist                    ////////////////////////////////////////////////////////////////////////////////////                    int  num2  =  2;                    for(int  n  =  0;  n  <  num2+1;  n++){                                  dividePoint  divPts  =  new  dividePoint(new  Vec3D  (newTarget.x,newTarget.y,0),(h/num2)*n);                      dividePoint.add(divPts);                              }                                      for(int  o  =  0;  o  <  dividePoint.size();  o++){                              dividePoint  disDivPt  =  (dividePoint)dividePoint.get(o);                      disDivPt.display();                                              }                                        ////////////////////////////////////////////////////////////////////////////////////                    //display  inner  circle                    ////////////////////////////////////////////////////////////////////////////////////                        stroke(150,90);                    strokeWeight(2);                    //ellipseMode(CENTER);                    ellipse(newTarget.x,newTarget.y,e*2,e*2);                    //stroke(100,90);                    //strokeWeight(2);                    //ellipse(newTarget.x,newTarget.y,f*2,f*2);                                        ////////////////////////////////////////////////////////////////////////////////////                    //cal  1  condition                    ////////////////////////////////////////////////////////////////////////////////////                    if(l  <  e  &&  c  >  a  &&  loc.x  !=  newTarget.x){                                              //    Situation1  unPoint  =  new  Situation1(new  Vec2D(loc.x,loc.y),a,d);                                        stroke(255,100,0);                            strokeWeight(1.5);                          line(loc.x,loc.y,d,loc.x,loc.y,a);                                            APoint  apts  =  new  APoint(new  Vec3D  (loc.x,loc.y,d),  new  Vec3D  (loc.x,loc.y,a));                        APoint.add(apts);                                            }                        //////////////////////////////////////                    //cal  2  condition                    //////////////////////////////////////

                   if(l  <  e  &&b>  a  &&  a>c  &&  loc.x  !=  newTarget.x){                                                  stroke(255,100,0);                        strokeWeight(1.5);                        line(loc.x,loc.y,d,loc.x,loc.y,c);                                                stroke(0,100,255);                        strokeWeight(5);                        line(loc.x,loc.y,c,loc.x,loc.y,a);

                       APoint  apts  =  new  APoint(new  Vec3D  (loc.x,loc.y,d),  new  Vec3D  (loc.x,loc.y,c));                    

   BPoint  bpts  =  new  BPoint(new  Vec3D  (loc.x,loc.y,c),  new  Vec3D  (loc.x,loc.y,a));                        APoint.add(apts);                        BPoint.add(bpts);                                            }                      //////////////////////////////////////                    //cal  3  condition                    //////////////////////////////////////

                   if(l  <  e  &&  a>b  &&  loc.x  !=  newTarget.x){                                                  stroke(255,100,0);                        strokeWeight(1.5);                        line(loc.x,loc.y,d,loc.x,loc.y,c);                        line(loc.x,loc.y,b,loc.x,loc.y,a);                                                stroke(0,100,255);                        strokeWeight(5);                        line(loc.x,loc.y,c,loc.x,loc.y,b);

                       APoint.add(apts);                        APoint.add(apts2);                        BPoint.add(bpts);                                            }                          //////////////////////////////////////                    //cal  4  condition                    //////////////////////////////////////

                   if(l  >  e  &&  l<f  &&  a<b  &&  loc.x  !=  newTarget.x){  

                       stroke(0,100,255);                        strokeWeight(5);                        line(loc.x,loc.y,d,loc.x,loc.y,a);

                       BPoint  bpts  =  new  BPoint(new  Vec3D  (loc.x,loc.y,d),  new  Vec3D  (loc.x,loc.y,a));                        BPoint.add(bpts);                                            }                                          //////////////////////////////////////                    //cal  5  condition                    //////////////////////////////////////

                   if(l  >  e  &&  l<f  &&  a>b  &&  loc.x  !=  newTarget.x){                                                  stroke(255,100,0);                        strokeWeight(1.5);                        line(loc.x,loc.y,b,loc.x,loc.y,a);                                              stroke(0,100,255);                        strokeWeight(5);                        line(loc.x,loc.y,d,loc.x,loc.y,b);

                       APoint  apts  =  new  APoint(new  Vec3D  (loc.x,loc.y,b),  new  Vec3D  (loc.x,loc.y,a));                        BPoint  bpts  =  new  BPoint(new  Vec3D  (loc.x,loc.y,d),  new  Vec3D  (loc.x,loc.y,b));                        APoint.add(apts);                        BPoint.add(bpts);                                            }                    

                 }                }            }                            ////////////////////////////////////////////////////////////////////////////////////            //cal  the  distance  between  region  point  and  agent(yellow  one)              ////////////////////////////////////////////////////////////////////////////////////              for(int  q  =  0;  q  <  regionPtCollection.size();  q++){                                    int  counter04  =  0;                  float  closeDistance02  =  1000000;                                    regPoint  rePts01  =  (regPoint)regionPtCollection.get(q);                  Vec2D  newTarget03  =  rePts01.getLocation();                                              for(int  u  =  0;  u  <  agentCollection.size();  u++){                                  Agent  newAgPts  =  (Agent)agentCollection.get(u);                    Vec2D  agTarget  =  newAgPts.getLocation();                                      

                   //////////////////////////////////////                    //display  new  the  height  of  targetRegNew                    //////////////////////////////////////        

                   //  stroke(100,0,100);                    //    strokeWeight(3);                    //line(targetRegNew.x,targetRegNew.y,0,  targetRegNew.x,targetRegNew.y,hei);                                              //point(targetRegNew.x,targetRegNew.y,hei);                    //////////////////////////////////////                    //display  inner  circle                    //////////////////////////////////////                        //  stroke(0);                    //strokeWeight(2);                    //  ellipse(targetRegNew.x,targetRegNew.y,radiusOut*2,radiusOut*2);                    //ellipse(disRegNewToinner.x,disRegNewToinner.y,radiusIn*2,radiusIn*2);                                          for(int  a  =  0;  a  <  APoint.size();  a++){                          APoint  unPt  =  (APoint)APoint.get(a);                          Vec3D  unPointDn  =  unPt.getLocation01();                          Vec3D  unPointUp  =  unPt.getLocation02();                                                    float  unHeiDn  =  unPointDn.z;                          float  unHeiUp  =  unPointUp.z;                                                    //  stroke(255);                          //strokeWeight(6);                            //  point(unPointDn.x,unPointDn.y,unPointDn.z);                          //point(unPointUp.x,unPointUp.y,unPointUp.z);                          //////////////////////////////////////                          //cal  1a  condition                          //////////////////////////////////////                                                                                                                    }                                                    //////////////////////////////////////                          //cal  2a  condition                          //////////////////////////////////////                          if(disRegNewToinner  <  radiusIn  &&  cc  <  unHeiUp  &&                          unHeiUp  <bb  &&  cc  >  unHeiDn&&  innerPo.x  !=  newTarget.x)                              }                          //////////////////////////////////////                          //cal  3a  condition                          //////////////////////////////////////                          if(disRegNewToinner  <  radiusIn  &&  cc  <  unHeiUp  &&                            bb  <unHeiDn  &&  unHeiDn  <  cc  &&  innerPo.x  !=  newTarget.x){                                        //////////////////////////////////////                          //cal  4a  condition                          //////////////////////////////////////                          if(disRegNewToinner  <  radiusIn  &&  bb  <  unHeiUp  &&                              unHeiDn  <  cc  &&  innerPo.x  !=  newTarget.x){  

                         }                        //////////////////////////////////////                        //cal  5a  condition                        //////////////////////////////////////                            if(disRegNewToinner  <  radiusIn  &&  cc  >  unHeiUp  &&                          bb  <unHeiDn  &&  unHeiDn  <  cc  &&  innerPo.x  !=  newTarget.x){                                  }                        //////////////////////////////////////                        //cal  6a  condition                        //////////////////////////////////////                                                    if(disRegNewToinner  >  radiusIn  &&  disRegNewToinner                        <radiusOut  &&  unHeiUp  <  bb  &&  innerPo.x  !=  newTarget.x){  

                       }                                  //////////////////////////////////////                        //cal  7a  condition                        //////////////////////////////////////                                                    if(disRegNewToinner  >  radiusIn  &&  disRegNewToinner                          <radiusOut  &&  unHeiUp  >  bb  &&  unHeiDn  <bb  &&  innerPo.x  !=  newTarget.x){                            }                                  //////////////////////////////////////                        //cal  8a  condition                        //////////////////////////////////////                                                    if(disRegNewToinner  <radiusOut  &&  unHeiDn  >bb  &&                        innerPo.x  !=  newTarget.x){  

A

A

BC

C

C

B

B

L1 L2 L3 L4 L5

A

A

A

D D D D

A

A A

A

A A

A

AD

B

BB

D

D

D

D

D

D

DC

C

EO' 0F

L1L2L3L4L5L6L7

L8 L8

A

D

 void  cal  (1-­‐8)a  condition(){

class  regPoint    &  voPoint  {    ///////////////////////////////////////////  //PROPERTIES  ///////////////////////////////////////////  Vec2D  location,  velocity;  float  radius;  float  hei;  ////////////////////////////////////////////  //CONSTRUCTOR  ////////////////////////////////////////////  voPoint(Vec2D  location,  float  hei){        this.location  =  location;    this.hei  =  hei;    velocity  =  new  Vec2D(0,0);    }  

 ////////////////////////////////////////////////  //METHOD  /////////////////////////////////////////////////void  display(){        stroke(0);    strokeWeight(8);    point(location.x,location.y);