Modern Programming for Generative Design · Modern Programming for Generative Design MSc in...
Transcript of Modern Programming for Generative Design · Modern Programming for Generative Design MSc in...
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
Generative Design
Modern Programming for Generative Design 2/36
Survey of currently used systems
I Textual Programming Languages
I Visual Programming Languages
I CAD Applications
Modern Programming for Generative Design 3/36
Survey of currently used systems
I Functionality
I Linguistic constructs
I Geometric abstractions
Modern Programming for Generative Design 4/36
Survey of currently used systems (Example)
Figure: Grasshopper program
Modern Programming for Generative Design 5/36
Survey of currently used systems (Example)
Figure: Grasshopper program (excerpt)
Modern Programming for Generative Design 6/36
Survey of currently used systems (Example)
Figure: Grasshopper program (excerpt)
Modern Programming for Generative Design 7/36
Survey of currently used systems (Example)
Figure: Grasshopper program (complete)
Modern Programming for Generative Design 8/36
Generative Design Principles
I Portability
I Parametric elements
I Functional operations
I ...
I Modern programming environment: Rosetta
Modern Programming for Generative Design 9/36
Portability
I Programs are not portable
I Vendor lock-in
Modern Programming for Generative Design 10/36
Portability in Rosetta
Modern Programming for Generative Design 11/36
Portability in Rosetta
Modern Programming for Generative Design 12/36
Portability in Rosetta
Modern Programming for Generative Design 13/36
Portability in Rosetta
Modern Programming for Generative Design 14/36
Portability in Rosetta
Modern Programming for Generative Design 15/36
Parametric elements
spiral(t) =
ρ = αt
φ = βt
z = t
Figure: Conic spiral tower
Modern Programming for Generative Design 16/36
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
Parametric elements
Figure: Conic spiral sampling
Modern Programming for Generative Design 17/36
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
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
Mathematical and geometric strictness
Symmetric difference (∆)
∆(R0,R1) = (R0
⋃R1) − (R0
⋂R1)
Modern Programming for Generative Design 19/36
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
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
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
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
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
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
Shape morphing
Modern Programming for Generative Design 22/36
Traceability
I Relationship between program and model
I Understanding, maintaining, debugging
Modern Programming for Generative Design 23/36
Traceability in Rosetta
Figure: Traceability: from program to model
Modern Programming for Generative Design 24/36
Traceability in Rosetta
Figure: Traceability: from model to program
Modern Programming for Generative Design 25/36
Immediate feedback
I Interactive input adjustment
I CAD applications designed for interaction
Modern Programming for Generative Design 26/36
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
Immediate feedback in Rosetta
Modern Programming for Generative Design 28/36
Evaluation
I Program development
I Programming environment extension
I Program analysis and conversion
Modern Programming for Generative Design 29/36
New backend: TikZ
Modern Programming for Generative Design 30/36
New frontend: RosettaFlow
Modern Programming for Generative Design 31/36
New frontend: RosettaFlow
Modern Programming for Generative Design 31/36
New frontend: RosettaFlow
Modern Programming for Generative Design 31/36
Program analysis and conversion
Modern Programming for Generative Design 32/36
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
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
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
Modern Programming for Generative DesignJose Lopes
Questions?
Modern Programming for Generative Design 36/36