# Introduction

This is a technical demonstration of an algorithm developed for adaptive urban master planning. The concept is to implement a programmatic approach to masterplanning. The masterplan layout can be controlled with a simplified user interface in Rhino3D.

Large-scale master planning normally takes days, weeks, or even months to create a single option. With this thought in mind, value of creating a computational methodology capable of producing quick design iterations, applying data science and machine learning workflows to aid analysis. This approach allows a cross-disciplinary team to quickly explore high performing scenarios capable of addressing the most important urban metrics to be taken into consideration when exploring the urban environment both on the neighborhood level and on a broader city-wide scale.
You can’t improve, what you can’t measure? Right? :)

In this process we take into account some of the most important urban metrics when exploring the urban environment both on the neighborhood level and on a broader city-wide scale.

A tesselation strategy is used to create the initial polygonaly division for primary and secondary roads. The structure for the tesselation is formed by an FP-Growth Algorithm, an efficient and scalable method for mining complete sets of pattern fragment growth.

``````
class Crack {
float x, y;
float t;    // direction of travel in degrees

Crack() {
// find placement along existing crack
findStart();
}

void findStart() {
// pick random point
int px=0;
int py=0;

// shift until crack is found
boolean found=false;
int timeout = 0;
while ((!found) || (timeout++>1000)) {
px = int(random(dimx));
py = int(random(dimy));
if (cgrid[py*dimx+px]<10000) {
found=true;
}
}

if (found) {
// start crack
int a = cgrid[py*dimx+px];
if (random(100)<50) {
a-=90+int(random(-2,2.1));
} else {
a+=90+int(random(-2,2.1));
}
startCrack(px,py,a);
} else {
//println("timeout: "+timeout);
}
}

void startCrack(int X, int Y, int T) {
x=X;
y=Y;
t=T;//%360;
x+=0.61*cos(t*PI/180);
y+=0.61*sin(t*PI/180);
}

void move() {
// continue cracking
x+=0.42*cos(t*PI/180);
y+=0.42*sin(t*PI/180);

// bound check
float z = 0.33;
int cx = int(x+random(-z,z));  // add fuzz
int cy = int(y+random(-z,z));

if ((cx>=0) && (cx=0) && (cy10000) || (abs(cgrid[cy*dimx+cx]-t)<5)) {
// continue cracking
cgrid[cy*dimx+cx]=int(t);
} else if (abs(cgrid[cy*dimx+cx]-t)>2) {
// crack encountered (not self), stop cracking
findStart();
makeCrack();
}
} else {
// out of bounds, stop cracking
findStart();
makeCrack();
}
}
}
``````

2019

Grasshopper

###### Language

Visual Scripting, Python

Sweden

###### Programs used

Rhino, Photoshop, After Effects