Modern Programming for Generative Design · Modern Programming for Generative Design MSc in...

44
Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos´ e Lopes Instituto Superior T´ ecnico Technical University of Lisbon July 18, 2012 Modern Programming for Generative Design 1/36

Transcript of Modern Programming for Generative Design · Modern Programming for Generative Design MSc in...

Page 1: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Modern Programming for Generative DesignMSc in Computer Engineering and Information Systems

Jose Lopes

Instituto Superior TecnicoTechnical University of Lisbon

July 18, 2012

Modern Programming for Generative Design 1/36

Page 2: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Generative Design

Modern Programming for Generative Design 2/36

Page 3: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems

I Textual Programming Languages

I Visual Programming Languages

I CAD Applications

Modern Programming for Generative Design 3/36

Page 4: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems

I Functionality

I Linguistic constructs

I Geometric abstractions

Modern Programming for Generative Design 4/36

Page 5: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems (Example)

Figure: Grasshopper program

Modern Programming for Generative Design 5/36

Page 6: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems (Example)

Figure: Grasshopper program (excerpt)

Modern Programming for Generative Design 6/36

Page 7: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems (Example)

Figure: Grasshopper program (excerpt)

Modern Programming for Generative Design 7/36

Page 8: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Survey of currently used systems (Example)

Figure: Grasshopper program (complete)

Modern Programming for Generative Design 8/36

Page 9: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Generative Design Principles

I Portability

I Parametric elements

I Functional operations

I ...

I Modern programming environment: Rosetta

Modern Programming for Generative Design 9/36

Page 10: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability

I Programs are not portable

I Vendor lock-in

Modern Programming for Generative Design 10/36

Page 11: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability in Rosetta

Modern Programming for Generative Design 11/36

Page 12: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability in Rosetta

Modern Programming for Generative Design 12/36

Page 13: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability in Rosetta

Modern Programming for Generative Design 13/36

Page 14: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability in Rosetta

Modern Programming for Generative Design 14/36

Page 15: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Portability in Rosetta

Modern Programming for Generative Design 15/36

Page 16: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Parametric elements

spiral(t) =

ρ = αt

φ = βt

z = t

Figure: Conic spiral tower

Modern Programming for Generative Design 16/36

Page 17: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Parametric elements

spiral(t) =

ρ = αt

φ = βt

z = t

function spiral(t) {

return cyl(a * t, b * t, t);

}

Figure: Conic spiral tower

Modern Programming for Generative Design 16/36

Page 18: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Parametric elements

Figure: Conic spiral sampling

Modern Programming for Generative Design 17/36

Page 19: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Parametric elements

function spiral(t) {

return cyl(a * t, b * t, t);

}

; sampling

function spiralPoints(n) {

var points = [];

for (var i = 0; i < n; ++i) {

points[i] = spiral(i / n);

}

return points;

}

sweep(spline(spiralPoints(n)), circle(1));

Modern Programming for Generative Design 18/36

Page 20: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Parametric elements in Rosetta

function spiral(t) {

return cyl(a * t, b * t, t);

}

sweep(functionCurve(spiral), circle(1));

Modern Programming for Generative Design 18/36

Page 21: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

Symmetric difference (∆)

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1)

Modern Programming for Generative Design 19/36

Page 22: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1)

function delta(r0, r1) {

return subtract(

union(r0, r1),

intersect(r0, r1));

}

Modern Programming for Generative Design 20/36

Page 23: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1)

function delta(r0, r1) {

var r0Copy = copy(r0);

var r1Copy = copy(r1);

return subtract(

union(r0, r1),

intersect(r0Copy, r1Copy));

}

Modern Programming for Generative Design 20/36

Page 24: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1)

function delta(r0, r1) {

var r0Copy = copy(r0);

var r1Copy = copy(r1);

if (isCurve(r0) && isCurve(r1)) {

return subtractCurves(

unionCurves(r0, r1),

intersectCurves(r0Copy, r1Copy));

} else if (isSurface(r0) && isSurface(r1)) {

...

} else if ...

Modern Programming for Generative Design 20/36

Page 25: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1)≡ (R0 − R1)

⋃(R1 − R0)

function delta(r0, r1) {

var r0Copy = copy(r0);

var r1Copy = copy(r1);

if (isCurve(r0) && isCurve(r1)) {

return subtractCurves(

unionCurves(r0, r1),

intersectCurves(r0Copy, r1Copy));

} else if (isSurface(r0) && isSurface(r1)) {

...

} else if ...

Modern Programming for Generative Design 20/36

Page 26: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness

∆(R0,R1) = (R0

⋃R1) − (R0

⋂R1) ≡ (R0 − R1)

⋃(R1 − R0)

function delta(r0, r1) {

var r0Copy = copy(r0);

var r1Copy = copy(r1);

if (isEmptyIntersection(r0, r1)) {

return union(

subtract(r0, r1),

subtract(r1Copy, r0Copy));

} else if (isCurve(r0) && isCurve(r1)) {

return subtractCurves(

unionCurves(r0, r1),

intersectCurves(r0Copy, r1Copy));

} else if (isSurface(r0) && isSurface(r1)) {

...

} else if ...Modern Programming for Generative Design 20/36

Page 27: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Mathematical and geometric strictness in Rosetta

I Functional operations

I Operations implement algebraic equivalences

I Dimension independent operations

Modern Programming for Generative Design 21/36

Page 28: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Shape morphing

Modern Programming for Generative Design 22/36

Page 29: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Traceability

I Relationship between program and model

I Understanding, maintaining, debugging

Modern Programming for Generative Design 23/36

Page 30: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Traceability in Rosetta

Figure: Traceability: from program to model

Modern Programming for Generative Design 24/36

Page 31: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Traceability in Rosetta

Figure: Traceability: from model to program

Modern Programming for Generative Design 25/36

Page 32: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Immediate feedback

I Interactive input adjustment

I CAD applications designed for interaction

Modern Programming for Generative Design 26/36

Page 33: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Immediate feedback in Rosetta

Example/Application AutoCAD Rhinoceros OpenGL

Orthogonal cones 1022 191 1Mobius truss 28837 9235 4446Scriptecture 21920 5088 210

Table: Time (in milliseconds) to regenerate the model

Modern Programming for Generative Design 27/36

Page 34: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Immediate feedback in Rosetta

Modern Programming for Generative Design 28/36

Page 35: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Evaluation

I Program development

I Programming environment extension

I Program analysis and conversion

Modern Programming for Generative Design 29/36

Page 36: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

New backend: TikZ

Modern Programming for Generative Design 30/36

Page 37: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

New frontend: RosettaFlow

Modern Programming for Generative Design 31/36

Page 38: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

New frontend: RosettaFlow

Modern Programming for Generative Design 31/36

Page 39: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

New frontend: RosettaFlow

Modern Programming for Generative Design 31/36

Page 40: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Program analysis and conversion

Modern Programming for Generative Design 32/36

Page 41: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Conclusion

Generative Design needs:

I Portability

I Mathematical and geometric strictness

I Correlation between programs and models

I Multiple paradigms and techniques

I Modern and pedagogic system

Modern Programming for Generative Design 33/36

Page 42: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Conclusion

I Devise set of Design Principles

I Rosetta implements these principles

I Rosetta is being used by designers

Modern Programming for Generative Design 34/36

Page 43: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Contributions

I Programming Languages For Generative Design: AComparative Studyjournal International Journal of Architectural Computing

I Portable Generative Design for CAD Applicationsconference ACADIA 11: Integration through Computation

I Essential Language Features for Generative Designconference III Simposio de Informatica (INForum 2011)

I Collaborative Digital Design (accepted)conference eCAADe 2012: Digital Physicality, Physical Digitality

Modern Programming for Generative Design 35/36

Page 44: Modern Programming for Generative Design · Modern Programming for Generative Design MSc in Computer Engineering and Information Systems Jos e Lopes Instituto Superior T ecnico Technical

Modern Programming for Generative DesignJose Lopes

Questions?

Modern Programming for Generative Design 36/36