ThesisPDF Available

Growing Venation Structures: Combining Open-Ended and Closed-Off Growth Using Space Colonization

Authors:

Abstract and Figures

The common structural forms of today, while optimized and becoming even more so, do not meet the needs for all structural circumstances. This thesis investigates the creation of a new hybrid structural system that merges open branching growth with stable closed growth. This is to allow for diversity of design, alongside structural stability. For this purpose, a space colonization algorithm implementing relative neighborhood graphs was designed, and structurally analyzed using the finite element analysis software Karamba. The convergence of both parametric and organic in this system, influences how the designer can interact with and affect the final form, both in the sense of structural performance and aesthetic appeal. A hypothetical situation, requiring a structure with limited spacing for the support base, intended to support a number of loads spread out in space was conceptualized and a curved funnel volume was formulated as the testing volume for the proposed system. This system is discussed in detail through this experimental application and ran through an optimization using genetic algorithms. As a result, a series of optimum initial parameters for venation structures within the controlled experiment are reached. Nevertheless, these are not inclusive to all structures. The system shows initial positive results at this stage, but requires further experimentation and optimization to reach real-world application.
Content may be subject to copyright.
Growing Venation Structures
Combining Open-Ended and Closed-O Growth Using Space Colonization"
Saba Sadat Mirmotalebi Sohi"
MSc Architectural Computation"
Bartlett School of Architecture, UCL"
September 2018"
!
Growing Venation Structures
Word Count: 9134"
This dissertation is submitted in partial fulfillment of the requirements for the degree of Master
of Science in Architectural Computation from The Bartlett School of Architecture, University College
London.
I, Saba Sadat Mirmotalebi Sohi, confirm that the work presented in this thesis is my own.
Where information has been derived from other sources, I confirm that this has been indicated in
the thesis.
September 2018
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!2
Abstract
Growing Venation Structures
ABSTRACT
The common structural forms of today, while optimized and becoming even more so, do not
meet the needs for all structural circumstances. This thesis investigates the creation of a new
hybrid structural system that merges open branching growth with stable closed growth. This is to
allow for diversity of design, alongside structural stability. For this purpose, a space colonization
algorithm implementing relative neighborhood graphs was designed, and structurally analyzed
using the finite element analysis software Karamba. The convergence of both parametric and
organic in this system, influences how the designer can interact with and affect the final form, both
in the sense of structural performance and aesthetic appeal. A hypothetical situation, requiring a
structure with limited spacing for the support base, intended to support a number of loads spread
out in space was conceptualized and a curved funnel volume was formulated as the testing volume
for the proposed system. This system is discussed in detail through this experimental application
and ran through an optimization using genetic algorithms. As a result, a series of optimum initial
parameters for venation structures within the controlled experiment are reached. Nevertheless,
these are not inclusive to all structures. The system shows initial positive results at this stage, but
requires further experimentation and optimization to reach real-world application.
Keywords: Venation structures, growth structures, organic structures, space colonization,
branching forms.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!3
Acknowledgement
Growing Venation Structures
ACKNOWLEDGEMENT
I would like to take this opportunity to express my appreciation and gratitude to my supervisor
Andy Lomas, for his patient guidance, insight and support, and Vassilis Papalexopoulos for his
helpful advice and assistance. Last but not least, I would like to thank my family for their
unconditional support and encouragement all throughout my studies.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!4
Contents
Growing Venation Structures
CONTENTS
Abstract……………………………..……………………………………………………………..… 3
Acknowledgement…………..…….……………………………………………………………..…. 4
Contents….………………………………………………..………………………….…………….. 5
List of Figures………………………….….………………………………………………………… 7
1. Introduction…………………………………………………………………………………….… 9
1.1 Organic Forms………………………………………………….……………………………. 9
1.2 Structural Forms…………………………………………………………………………..…. 9
1.3 Objective……………………………………………………………………………….…… 11
1.4 Thesis Structure….………………………………………………………………………… 13
2. Literature Review……………………………………………………………………….………. 14
2.1 Growth Systems………………………………………………………………………….… 14
2.1.1 L-Systems……………….……………………………………………………………. 15
2.1.2 Laplacian Growth………………………………………………………………..…….. 16
2.1.3 Accretive Growth…………………………………………………………………..….. 17
2.1.4 Differential Growth…………………………………………………………………..…. 19
2.1.5 Aggregation Growth………………………………………………………………..…. 21
2.1.6 Space Colonization……………………………………………………………………. 23
2.2 Finite Element Analysis (FEA)…………………………………………………………….… 24
2.2.1 Introduction……………………………………………..……………………….……. 24
2.2.2 Karamba………………………………………………………………………………. 27
3. Method…………………………………………………………………………………….……. 29
3.1 Procedure Overview…………………………………………………………….…………. 29
3.1.1 Preliminaries………………………………………..…………………….………….… 30
3.2 Attraction Point Generation……………………………….……………….………….……. 31
3.2.1 2 Dimensional…………………………………………………..…………….………. 31
3.2.2 3 Dimensional…………………………………………………………………….…… 32
3.3 Space Colonization Algorithm………………………………………………………….…. 32
3.3.1 Open Venation Algorithm…………………………………………………………..…. 33
3.3.2 Closed Venation Algorithm………………………………………………….………… 34
3.3.3 Fixing Small Growth Anomalies……………………………………………………….. 36
3.4 Branch Thickness Calculations……………………………………………………………. 37
3.5 Merging the Open and Closed Venation Algorithms……………………………………… 38
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!5
Contents
Growing Venation Structures
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!6
List of Figures
Growing Venation Structures
LIST OF FIGURES
Figure 1: Impact of the number of attraction points and the kill distance on the generated tree
form……………………………………………………………………………………………………… 11
Figure 2: Chair prototype………………………………………………………………………………. 12
Figure 3: String substitution as cell division……………………………………………..……………. 15
Figure 4: Three stages of turtle graphics……………………………………………………………… 15
Figure 5: Examples of tree-like structures with ternary branching……………………………….…. 16
Figure 6: The Laplacian model after four iterations……………………………..……………….…… 16
Figure 7: A series of snapshots from the Laplacian growth model…………………………………. 17
Figure 8: Four successive stages in the iterative geometrical construction……………..…….…… 18
Figure 9: Objects generated with the accretive growth model……………………………….…..…. 18
Figure 10: Edge-based growth – The edge of the hemisphere is emitting growth signal and is the
fastest area of expansion……………..………………………………………………………….…….. 19
Figure 11: Line-based growth – The center of the hemisphere is emitting growth signal and is the
fastest area of expansion. Overtime it expands into a ridge of growth…………………………….. 20
Figure 12: Point-based growth – The center of the hemisphere is emitting growth signal and is the
fastest area of expansion. Overtime it bifurcates…………………………………………………….. 20
Figure 13: Linear differential growth…………..………………………………………………………. 21
Figure 14: Random Dropped Ballistic Aggregation (RDBA). The dropped particle is aggregated to
the closest tendril………….……………………………………………………………………………. 22
Figure 15: Random Dropped Ballistic Aggregation with pixels being dropped on the circumference
of the outer circle……………………..………………………………………………………………… 23
Figure 16: Random Dropped Ballistic Aggregation with a circular bias of the dropped
pixels…………………………………………….………………………………………………………. 23
Figure 17: Key steps of the proposed space colonization method……………………….………… 24
Figure 18: Particle movement diagram………….……………………………………………………. 25
Figure 19: Particle motion calculation…………………………………………………………………. 25
Figure 20: One of the resulting patterns………………………..…………………………………….. 25
Figure 21: detailed view of a leaf, showing intricate venations…………………………….……..…. 26
Figure 22: Key steps of the proposed growth method……………………………………….……… 29
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!7
List of Figures
Growing Venation Structures
Figure 23: Uniform point generation which gives points uniformly distributed in a"quadrilateral. The
points not in the"triangle interior"are then transformed into the corresponding point inside the
triangle…………………………………………………………………………………………………… 32
Figure 24: One iteration of the space colonization algorithm……………….……………………….. 33
Figure 25: structure as shown with nodes in OpenFrameworks and with varying pipe radii in
Rhino……………………………………….……………………………………………………………. 41
Figure 26: Graph of 200 iterations of the genetic algorithm with a population of 50 individuals.… 42
Figure 27: Graph of population fitness over one generation….…………………………………..…. 43
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!8
Introduction
Growing Venation Structures
1. INTRODUCTION
“Progress in design of new structures seems to be unlimited.”
— Klaus-Jurgen Bathe
1.1 ORGANIC FORMS"
Organic growths, are nature’s method of progression from a few cells into an intricate
system of design. The resulting forms, are based on the types of organism and the way their
growth system is programmed into them. One remarkable type of growth system, is seen in
modular organisms, who are typically built of repeated units and have fractal-like forms. In most
of these organisms, the modules that build up the entire system have a distinctive form, where
as the grown form as a whole is most often an indeterminate shape. These forms are usually
defined in a vague or qualitative manner, using terms such as “branching”, “tree-like”, “vein-like”
and etc.
A remarkable feature of most organic growth systems, is that they are strongly impacted by
their surrounding environmental conditions (e.g. light, food sources and resisting forces such as
wind and weight). These conditions affect most features of each distinct growth, but this is
something that is lacking for the most part in man-made structures. Another remarkable feature,
is that they only grow where they are needed. There is for the most part an optimization of
materials and forms seen in nature, that can’t be seen in usual man-made structures. In short,
there is no waste in nature. For these properties, a more organic approach to structural forms
was studied to use in architectural design systems.
1.2 STRUCTURAL FORMS"
Most branching structures, such as trees or corals observed in nature, conform to an open
ended branching system. These structures take one of their more optimal forms to fulfill their
purpose and support the forces applied to them during their life. These forces are mainly their
own mass and certain external forces such as wind and water pressure. This open structure is
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!9
Introduction
Growing Venation Structures
sufficient to support the structure's own weight, but would not be able to perform well when the
job of supporting other loads is entrusted to them
Closed structural forms, such as forms in space frame and truss structures, fill their entire
enclosed space with prism structures and cannot accommodate changes in their load bearing
cross sections. However they perform exceptionally well in the bearing of external loads and
forces.
in this dissertation, range of organic growth simulations was studied, to gain a better
understanding of current methods for creating forms seen in nature, their results and their input
and output data forms. L-systems, laplacian growth, accretive growth, differential growth,
aggregation growth and space colonization systems were researched. The important factors in
this exploration, in regards to a suitable algorithm for a structural form was threefold.
The shape a system takes as it grows is the first and foremost of these. The resulting
forms, while organic and observed in nature, might not be very suitable for the desired structural
support of an architectural element. Columns, beams, roofs and other elements used in design
need to perform well structurally, as well as aesthetically and in terms of usage. Shapes that are
disconnected, too dispersed, flat, or otherwise unfit cannot be considered here.
Another factor is the capability of the system to be influenced by the user’s intended design
criteria and limitations. Systems that are able to create organic shapes but cannot be influenced
or controlled in any way would not be much use in the world of architecture and design. The
level of control the user has over the system and its progress was a notable element. Systems
that were too uncontrollable would not fit the required design criteria, while systems that were
too controllable would lose their interesting and organic shapes and become too predictable.
The last factor, is a limitation set by the current technology and advancements available the
field of structural calculation and analyzation. Performing structural analysis on some data forms
is easier and more accurate. Analyzing beam and column data, with defined cross sections
requires less time, computational power and is much less complex. Analyzing voxel data
however, is a complicated and heavy-duty process. Other data forms, such as boundary
representation methods would first need to be converted to other data types. In short, it would
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!10
Introduction
Growing Venation Structures
make much more sense to have a system generating beam data for analysis, and only
converting them to 3D volumetric data for fabrication purposes at the end.
1.3 OBJECTIVE"
This dissertation aims to research into a structural design system that can be adaptive to
the volumetric and load bearing needs of the designer, and looks into how parameters defining
this system affect it’s outcome, both in form and structural performance. The proposed system
is intended as a hybrid that brings together two different systems to create a more intelligent
design process for unorthodox structural shapes in requirement of space functionalities.
The first, is the system seen most in nature; dividing branches that reach out towards
empty areas, e.g. trees, leaf venations, corals and etc. A wide variety of these forms are
simulated and studied by Runions, Lane and Prusinkiewicz as they go through the process of
modeling trees in their paper (Runions, Lane and Prusinkiewicz, 2007).
Figure 1: Impact of the number of attraction points and the kill distance on the generated tree form (Runions,
Lane and Prusinkiewicz, 2007).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!11
Introduction
Growing Venation Structures
The second, is the closed loop structure types most widely used today in architectural
design based on load analysis and optimization. Similar to the resulting chair structure from
Bhooshan, Fuchs and Bhooshan’s topology optimization design system and their use of
statistical learning to approximate topology optimization material density results (Bhooshan,
Fuchs and Bhooshan, 2017).
Figure 2: Chair prototype (Bhooshan, Fuchs and Bhooshan, 2017).
The convergence of both parametric and organic in this system, influences how the
designer can interact with and affect the final form, both in the sense of structural performance
and aesthetic appeal. A hypothetical situation, requiring a structure with limited spacing for the
support base, intended to support a number of loads spread out in space was conceptualized
and a curved funnel volume was formulated as the testing volume for the proposed system.
A space colonization algorithm was chosen out of the organic growth simulations, because
of its capability to accommodate the creation of both these forms while allowing the designer to
manipulate and shape the structure based on the design criteria and limitations of the
structure’s placement and load bearing duties. This allowed for a systems that can grow a
branching structure and fill a desired volumetric space, while the addition of cross connections
significantly changes the structural performance of the structure. After the birth of this system, a
genetic algorithm was used on it to analyze the influence of changes in the input parameters on
the structural performance and material use of the overall structure.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!12
Introduction
Growing Venation Structures
1.4 THESIS STRUCTURE "
Following the introduction, the literature review focuses on an overview and analysis of
researched growth simulation algorithms most used in computer aided design, followed by an
overview of Finite Element Analysis (FEA) and Karamba, the FEA tool used for the analyses in
this dissertation. The next chapter is the methodology, going through the setup and different
parts of the proposed system, ending with a software overview. Afterwards, the results chapter
discusses the results and the outcomes of the growth system and its analyses. Finally, the last
chapter presents the conclusion of the gathered data and research.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!13
Literature Review
Growing Venation Structures
2. LITERATURE REVIEW
2.1 GROWTH SYSTEMS"
Organic growth, is the natural process of a specimen progressing from a few cells into an
intricate system of design. The forms these growths take, are based on their type of organism
and the way their growth algorithm is programmed into them. One remarkable type of growth
system, is seen in modular organisms, who are typically built of repeated units and have fractal-
like forms. In most of these organisms, the modules that build up the entire system have a
distinctive form, where as the grown form as a whole is most often an indeterminate shape. The
indeterminism of these forms, means that repeated growths of these systems under similar
conditions would lead to different versions of the growth form. Which is in contrast to unitary
organisms, wherein a single-celled stage develops into predefined deterministic structure. These
modular forms are usually vaguely and or qualitatively defined, using terms such as “branching”,
“tree-like”, “vein-like” and etc (Kaandorp and Kübler, 2001).
A remarkable feature of most organic growths, is that they are strongly impacted by their
surrounding environmental conditions (e.g. light, food sources and resisting forces such as wind
and weight). These conditions affect most features of each distinct growth, its form, speed, size
and etc. This is something that is lacking for the most part in man-made structures. Forces
might affect column thickness, or solar positions might affect column placement for window
bearing surfaces, but the overall shape of these structures basically stays the same.
Another remarkable feature of these forms, is that they only grow where they are needed.
There is for the most part an optimization of materials and forms seen in nature, that can’t be
seen in man’s usual structures. There is no waste in nature, if a tree needs more support, it will
thicken its branches, if it requires more nourishment, it will branch out and create more leaves
leading to an increase in synthetic cells.
For these properties, a more organic approach to structures was studied to use in
architectural systems. A few different methods currently used for simulating these natural
structures were assessed and a brief summary and analysis provided below.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!14
Literature Review
Growing Venation Structures
2.1.1 L-SYSTEMS"
L-systems were introduced in 1968 by biologist Aristid Lindenmayer as a mathematical
model of plant and organism growth systems. L-systems aren’t limited to describing organic
formations, they’re also used for other complex self-similar fractals and structures. They are
also remarkably compact, considering the amount of details these recursive algorithms
produce (Flake, 1998).
L-systems describe growth in continuous steps, so they consist of a starting seed cell
(axiom), and a description of how new cell types can be generated from old cells (production
rules). Consider the following L-system as an example (written in turtle graphics):
Axiom: #B
Rules: #B F [-B] + B
#F FF
Figure 3: String substitution as cell division Figure 4: Three stages of turtle graphics
(Flake, 1998). (Flake, 1998).
While these algorithms can be used to create intricately detailed patterns and forms,
there is a certain determinism to them. As such, they weren’t deemed very appropriate to
design organic structures with, since the rules are hard-coded into the system and the
emerging forms don’t really have a freedom of choice in the direction and shape they grow
and can’t interact with a designer’s needs.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!15
Literature Review
Growing Venation Structures
Figure 5: Examples of tree-like structures with ternary branching (Prusinkiewicz and Lindenmayer, 1990).
2.1.2 LAPLACIAN GROWTH"
This type of growth is a branching growth that responds to the gradient in an
environmental diffused quantity. The diffused quantity can be thought of as the time-
averaged kinetic energy of the flow, which increases away from the boundary. This model
uses the differences in the diffused quantity around the tips of growth. The details of the
calculations won’t be expanded here (Kaandorp and Kübler, 2001).
Figure 6: The Laplacian model after four iterations (Kaandorp and Kübler, 2001).
While this system has a more diverse branching and growth pattern, the system isn’t the
easiest to control with external and environmental forces. Moreover, the resulting structure
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!16
Literature Review
Growing Venation Structures
consists of a series of pixels (2D) or a volumetric mesh (3D) which makes analyzing it
comparatively complex.
Figure 7: A series of snapshots from the Laplacian growth model (Kaandorp and Kübler, 2001).
2.1.3 ACCRETIVE GROWTH"
Accretive systems are formed by a surface normal deposition process, wherein skeleton
material is deposited on top of previous layers, which remain unchanged throughout the
process. This process most frequently results in a radiate accretive architecture. A major
factor influencing the morphology of these systems is availability of light.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!17
Literature Review
Growing Venation Structures
Figure 8: Four successive stages in the iterative Figure 9: Objects generated with the accretive
geometrical construction (Kaandorp and Kübler, 2001). growth model (Kaandorp and Kübler, 2001).
The resulting forms created are considerably space-filling and there isn’t much negative
space left between the structures, making it an unsuitable fit for structural support solutions.
As well as the fact that the resulting structure is in the form of volumetric mesh data, which
makes analyzing it very computationally difficult.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!18
Literature Review
Growing Venation Structures
2.1.4 DIFFERENTIAL GROWTH"
Biological systems are able to produce structures with specific reproducible forms,
through coordinated subdivision and differentiation. Differential growth aims to create form by
varying the growth rates of their system through space and time. In short, growth isn’t
uniform, but differentiated.
Floraform is an example of an edge-based differential growth on a thin surface. This
system includes a physics simulation of an elastic shell with a curved rest configuration. The
surface is modeled as a triangular half-edge mesh. The system evolves by the calculation of
the sum forces on each vertex and new positions being integrated at each time-step.
Differential growth occurs by the expansion of the mesh edges. The growth rate is controlled
by the distance along the surface from the edge and the edge lengths are increased based
on this distance. Mesh edges are subdivided and the faces split into two when they grow
longer than a certain length to maintain the needed level of detail.
Figure 10: Edge-based growth – The edge of the hemisphere is emitting growth signal and is the fastest area
of expansion (Louis-Rosenberg, 2015).
The physical simulation treats each mesh edge as a spring which resists the stretching
of the surface. The edge between each two faces also has a bending energy based on the
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!19
Literature Review
Growing Venation Structures
angle between them which resists bending. To prevent self-intersections of the surface, each
vertex also enacts a repulsion force on any vertices that cross its proximity radius. A point-
based and line-based system are also explored for this system (Louis-Rosenberg, 2015).
Figure 11: Line-based growth – The center of the hemisphere is emitting growth signal and is the fastest area
of expansion. Overtime it expands into a ridge of growth (Louis-Rosenberg, 2015).
Figure 12: Point-based growth – The center of the hemisphere is emitting growth signal and is the fastest
area of expansion. Overtime it bifurcates (Louis-Rosenberg, 2015).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!20
Literature Review
Growing Venation Structures
A linear implementation of differential growth is explored by Toncean where an
agglomeration"of nodes are grown to create an intricate maze-like pattern (Toncean, 2017).
Figure 13: Linear differential growth (Toncean, 2017).
The output data from these algorithms is usually a mesh or 3D data form, which
wouldn’t be very useful for structural analysis. While the created forms do have an aesthetic
appeal and are shaped by their environment and the growth criteria described for them, they
aren’t ideal as a structural form to support heavy loads.
2.1.5 AGGREGATION GROWTH"
Aggregation is the process of growing a cluster by adding one particle at a time to a
previous growth or an initial seed. These growths are mainly concerned with generating
aggregates formed by the adjoining of randomly dropped particles. There are of course
several different methods utilized, such as random walking particles or movements in
simulated Brownian motions. Only a hybrid model of these two methods is explained here.
In this system, named Random Drop Ballistic Aggregation by the author, an initial
particle is set in the center. Then other particles are released one by one, at random locations
and join the cluster at the closest point in the current aggregation. This aggregation growth
algorithm is more advanced in comparison with the rest, as it encourages tendril growth and
doesn’t require further controlling parameters like launching and killing circles, space leaping
techniques or a sticking mask (Roberts, 2001).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!21
Literature Review
Growing Venation Structures
Figure 14: Random Dropped Ballistic Aggregation (RDBA). The dropped particle is aggregated to the closest
tendril (Roberts, 2001).
This system is in essence very similar to the space colonization algorithm discussed in
the next section, with differences in their implementation and data storage techniques. While
they both create unpredictable branching forms that populate a certain selected area, this
method stores its clusters in a 2D voxel-grid and would be similar implemented in 3D.
Although methods could be used to convert the voxel clusters to linear beam data, it would
make the process much more arduous and reduce the accuracy of the generated forms.
Controlling and guiding these forms for the required design criteria, and also to create closed
forms for structural performance, would be a complicated if not impossible task. Also
creating closed forms would require the particles to be dropped almost exactly in place
which would be unlikely, or require biased intelligent particle dropping.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!22
Literature Review
Growing Venation Structures
Figure 15: Random Dropped Ballistic Aggregation Figure 16: Random Dropped Ballistic Aggregation
with pixels being dropped on the circumference with a circular bias of the dropped pixels
of the outer circle (Roberts, 2001). (Roberts, 2001).
2.1.6 SPACE COLONIZATION"
Space colonization systems, as their names suggest, function to fill a certain volume (or
surface in a 2D version) with their desired structural forms. The most common method used
for these systems is to populate the desired space with attractor nodes. Then the growth
initializes from the predefined set of initial starting points and grows towards the average of
the attraction points in increments of the node radius. This results in a natural branching
system that begins at the stem and ends at the branch tips (Runions, Lane and
Prusinkiewicz, 2007). Variations of this method are to start with a simple initial geometry and
perform a type of growth (e.g. marginal, uniform isotropic, uniform anisotropic, and non-
uniform anisotropic) on the geometry and repopulate it at every step of the algorithm
(Runions et al., 2005).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!23
Literature Review
Growing Venation Structures
Figure 17: Key steps of the proposed space colonization method (Runions, Lane and Prusinkiewicz, 2007).
An intriguing alternative method is to start the growth from the attractor points, and have
the nodes grow in increments towards the average of the base node (converging attraction
point) and the node’s nearest neighbor. This results in branching back-growths that slowly
merge together and converge at the attraction point (Rodkaew et al., 2002).
Interestingly, this method yields resulting forms that are visually very similar to the first
method described. Which isn’t surprising considering the systems are for the most part
similar, and the main difference is the starting point for the growths. However it can be seen
that this method produces messier “hairier” branches compared to the Runions, Lane and
Prusinkiewiczt method.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!24
Literature Review
Growing Venation Structures
Figure 18: Particle movement Figure 19: Particle motion Figure 20: One of the resulting
diagram (Rodkaew et al., 2002). calculation (Rodkaew et al., 2002). patterns(Rodkaew et al., 2002).
Interestingly, this method yields resulting forms that are visually very similar to the first
method described. Which isn’t surprising considering the systems are for the most part
similar, and the main difference is the starting point for the growths. However it can be seen
that this method produces messier and “hairier” branches compared to the Runions, Lane
and Prusinkiewiczt method.
The space colonization algorithm was chosen for the system of this dissertation, mainly
because of its capability to create a hybrid between two structural systems: the open ended
branching system of trees and the closed structural forms in space frame and truss
structures. This allows for the freedom of movement and required element distribution based
on force propagation seen in branching structures, and the stronger closed geometries
observed in closed-form structures. A 2D natural manifestation of this behavior is what is
observed in most leaf structures (figure 21). The allowance of anastomosis (cross
connections) between nodes significantly changes the structural performance of branching
structures.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!25
Literature Review
Growing Venation Structures
Figure 21: detailed view of a leaf, showing intricate venations!(Dermid, 2018).
2.2 FINITE ELEMENT ANALYSIS (FEA)"
2.2.1 INTRODUCTION"
Finite element analysis is a method of approximately solving physical problems, used
very widely in engineering disciplines. It’s mainly used for problems where no exact solution,
expressible in a mathematical form, can be directly found. As such, it’s a numerical rather
than an analytical method. This method is required because analytical methods can’t cope
with the real complex problems faced in engineering analysis and design. FEA when applied
to a realistic model of an engineering component, requires heavy computation.
The physical problem usually involves a certain structure or structural element subjected
to certain loads and forces. The idealization of the physical model to a mathematical model
requires certain assumptions leading to differential equations governing the mathematical
model. The FEA then solves this mathematical model in a numerical procedure (Bathe,
2014).
Finite element analysis is basically a piecewise process which can be applied to one
dimensional problems, but is usually applied to an area or volume within which the problem
is defined. This is split into a number of smaller areas or volumes which are called finite
elements. This division process is called discretization, into an assembly of elements which
would be a mesh. Elements can take various shapes and be either two or three dimensional.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!26
Literature Review
Growing Venation Structures
If the system is confined to linear elastic analysis, then the quantity that is first found in
the analysis is the displacement at a series of points called nodes, which can be positioned
at the corners, mid-sides or even inside the element.
The displacement of each point in an element is a function of the nodal displacements of
the element. This way, the problem of finding the displacement of every point is replaced by
finding the displacement of a finite number of nodes. The displacement of each point is then
defined as the displacement of the nodes of the element it belongs to. When a 2D model is
considered, the displacement of each node consists of two parts: one along the reference !
axis, and one along the ! axis, these are called the degrees of freedom. Each node has two
degrees of freedom in this case, but in a 3D model the figure would be three. If there are !
nodes in the model, then the total number of degrees of freedom would equal ! (! is the
number of degrees of freedom per node), as compared to an infinite number in the actual
component. The computational time and load of the analysis naturally go up with the
increase of the number of degrees of freedom. After calculating the nodal displacements, the
program then goes on to find the corresponding strains, and from them the stresses
(Modlen, 2008).
2.2.2 KARAMBA"
Karamba is a finite element program, with the added advantage of ease of use for non-
experts, an interactive workflow, and being tailored to the needs of architects in early design
stages. Karamba is fully embedded in the environment of Grasshopper, a parametric "plug-in
for the 3D modeling tool Rhinoceros. This makes it easy to combine the program with code
and data imported from other softwares as well (Preisinger, 2012).
The program has components to convert line data to beams, in which cross section
shapes and dimensions can be specified. A wide range of forces such as point, line, gravity
and etc. can to be applied on the structure. Support points and their type (translation and
rotation specifications along the !, ! and ! axes) can also be specified to setup the system.
From these components, a new finite element analysis can be assembled. After
completing its calculations, the assembly provides the user with a series of information in
x
y
n
n x
x
x
y
z
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!27
Literature Review
Growing Venation Structures
regard to the model, such as mass, sum forces, center of gravity, displacement, and a
number of different ways to view the model (e.g. viewing displacement, deformation, applied
loads, supports, axes, and element and cross section data).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!28
Method
Growing Venation Structures
3. METHOD
3.1 PROCEDURE OVERVIEW"
The steps of the procedure are as shown in figure 21. A 3D closed geometry mesh is given
as an input (a), representing the allocated volumetric space for the structure’s growth. The load
bearing parts of the volume are also input as a surface mesh.
Figure 22: Key steps of the proposed growth method:
(a): initial mesh (b): open venation point population (pink nodes) (c): start of open venation growth (red lines
specify attraction forces for each attractor) (d): open venation progressing (cyan nodes specify the grown
open structure) (e): finished open venation (f): beginning of closed venation (red lines specify attraction forces
for neighbor attractors to each node) (g): closed venation progressing (navy nodes specify the grown closed
structure) (h): end of closed venation (i): addition of structure thickness and anastomoses (magenta lines)
(j): final structure in context of the initial mesh (k): structure in analysis mode (l): structure after load
implementation displaying displacement
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!29
Method
Growing Venation Structures
At the beginning of the venation generation, the space within the 3D mesh and the area of
the load bearing surface (in this case the circular top surface of the geometry) are seeded with a
set of attraction points (b). These points signal the availability of empty space for growth, and
are removed when they are reached by one or more branches, depending on the venation type
(c-h). The number of attraction points distributed is something that is specified by the user and
affects the intricacy, detail and module shape of the structure. Given the attraction points, the
structural skeleton is formed by an iterative process that begins at the initial starting points
specified by the user (these signify the base of the structure). In each iteration, new nodes
delimiting short branch segments, extend the skeleton in the direction of the average of the
nearby attraction points. The length of these short segments, is something that is specified by
the user based on the overall size of the input geometry. This process terminates when all
attraction points have been reached, and deactivated.
This process is run once for the open venation algorithm, and then a second time for the
closed algorithm with the closed growth nodes as the starting points for this growth. After the
second venation is complete, the thickness of the grown branches is computed (i) and the data
saved to disk. This file is then read by the analysis software (k) and ran through a finite element
analysis procedure, where the maximum displacement and total mass of the structure is
calculated (l) and then saved to disk.
This data is used in a genetic algorithm process, in an attempt to optimize future grown
structures, by trying to find higher fitness individuals who have lower displacement and mass,
while exploring the varying range of the degree of openness and the surface vs. volume ratio.
The final structure is converted into a closed mesh structure for fabrication."
3.1.1 PRELIMINARIES"
The input to the algorithm consists of: (1) the 3D geometry mesh, (2) the load bearing
area of the volume as a surface mesh, (3) support points, (4) total number of attraction points
to populate the geometry and surface with, (5) the radius of the nodes generated by the
growth system, (6) division ratio for the number of the attraction points assigned to the
volume and the surface, (7) openness ratio (which means the ratio of total attractors used to
grow the open venation algorithm as opposed to the closed venation).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!30
Method
Growing Venation Structures
3.2 ATTRACTION POINT GENERATION"
Attractor population occurs in both the volume intended to enclose the entire structure and
the load bearing surface. The ratio between the number of attractors in the volume and on the
surface is one of the parameters input into the genetic algorithm for optimization.
Attractors on the surface are required to ensure that the structure reaches the surface it's
supporting, and not hang half way. Attractors in the volume are used to create a well dispersed
structure. Without these, branching would only occur at the very end of the growth, and wouldn't
create gradual natural branching to be strong enough to support the forces and would make forms
that are much more susceptible to breaking. They also allow for the cross connections to be built in
a volume not just in the top surface layer, strengthening the structure and creating a crossover
between a completely branching and a fully connected structure.
The volume attractors do sometimes create an unwanted negative consequence, which is the
appearance of lone terminal branches that don't reach any load bearing locations or support any
loads. Methods of dealing with this issue, such as pruning or redirecting the lone branches, can be
explored in further developments.
3.2.1 2 DIMENSIONAL"
The load bearing surface is input as a surface mesh, which consists of a number of
triangular faces. To populate this surface evenly, the sum area of all of the faces are
calculated using the sine rule for area of ! with side lengths !, !, ! and corresponding
angles !, !, ! (Weisstein, 2018a).
"
The total number of points are designated by the ratio of the total attraction points
assigned to the load bearing area (as opposed to volume filling points). The number of points
for each face is determined based on the ratio of the area of each triangle mesh face in
relation to the total area of the mesh previously calculated. Given a triangle with one vertex at
ΔABC
a
b
c
A
B
C
Δ=1
2bcSin A
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!31
Method
Growing Venation Structures
the origin and the others at positions ! and !, the new points are generated using a
uniform triangle point picking algorithm as described below.
"
Where ""and"""are uniform variates in the interval"", which generates points uniformly
distributed in a"quadrilateral. Then the points outside of the mesh triangle are transformed to
their corresponding point inside the triangle (Weisstein, 2018b)
Figure
23: Uniform point generation which gives points uniformly distributed in a!quadrilateral (left figure). The points
not in the!triangle interior!are then transformed into the corresponding point inside the triangle (right figure)
(Weisstein, 2018b).
3.2.2 3 DIMENSIONAL"
The closed volumetric geometry is input as a mesh. This mesh is first used to calculate a
bounding box for the geometry. Then the algorithm iteratively generates random points inside of
the bounding box. To determine wether each point is inside the geometry or not, a ray-casting
algorithm (Hayasaka, 2018) with a slight adjustment to count intersection counts was used to
cast a ray originating at the random point outwards in a random direction. If the ray comes
across an even number of intersections, it’s concluded that the point is outside of the closed
mesh and discarded, and if odd, it’s concluded to be inside and added to the attractor list.
3.3 SPACE COLONIZATION ALGORITHM"
v1
v2
x=a1v1+a2v2
a1
a2
[0,1]
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!32
Method
Growing Venation Structures
The cornerstone of the proposed method is the space colonization algorithm proposed by
Runions et al. (Runions, Lane and Prusinkiewicz, 2007) and a 3D extension of the closed
venation method proposed by Runions et al. (Runions et al., 2005), which uses the rivalry for
space as the key factor for determining the branching structures. The details and differences are
explained in the next few sections.
3.3.1 OPEN VENATION ALGORITHM"
The algorithm operation begins with an initial configuration of " attraction points
(hundreds or thousands) and one or several initial venation nodes (support points). The
structure is generated iteratively, where in each iteration, an attraction point may influence the
venation node that is closest to it. There might be a number of attraction points that influence
a single venation node "; this set of points will be denoted with ". If " is not empty, a
new venation node " will be created and attached to " with the line segment ". The
node " will be placed at a distance of " from " and in the direction of the average sum of
the normalized vectors towards all the sources !. Thus ! where:
! and !
Once the new nodes have been added, a proximity check is performed to see if any of
the new nodes have grown close enough towards the attractors. An attractor ! is
deactivated once at least one node ! has reached a threshold kill radius value of ! (Runions,
Lane and Prusinkiewicz, 2007)."
N
v
S(v)
S(v)
v
v
(v,v)
v
D
v
sS(v)
v=v+D̂
n
̂
n=
n
n
n=
sS(v)
sv
sv
s
v
dk
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!33
Method
Growing Venation Structures
Figure 24: One iteration of the space colonization algorithm (Runions, Lane and Prusinkiewicz, 2007).
The process is illustrated in figure 23. The venation is currently at the stage where it
consists of six nodes (black disks) and there are four attraction points (turquoise circles) (a).
First each node has to be associated to the node it’s closest to (b). This establishes the set
of attraction points that influence each node and the normalized vector pointing from the
node to each attractor is calculated (c). These vectors are added and the normalized vector
of the sum is calculated. These vectors provide the basis for locating new venation nodes (d).
The new nodes are incorporated into the venation structure, in this case extending the main
axis and initiating a lateral branch (e). The neighborhoods of the attraction points are now
tested for the inclusion of the new nodes (f). The two left most attractors have been
penetrated and are thus removed (g). The nodes closest to the remaining attraction points
are then identified, initializing the next iteration of the process (h). The algorithm involves
repetitively testing the set of attraction points for proximity to the newly generated tree
nodes.
3.3.2 CLOSED VENATION ALGORITHM"
In order to generate closed venation patterns, the previous algorithm was modified so
that more than one node may be allowed to grow towards the same attractor. This situation
would happen when several nodes are close to the same attractor, yet are relatively far from
each other. (Runions et al., 2005) This concept was formalized using the notion of relative
neighborhood (Toussaint, 1980).
Given a point set !, point ! is a relative neighbor of a point !, if and only if for
each ! that is closer to ! than to !, ! is closer to ! than to !. Mathematically, point !
belongs to the relative neighborhood of !, denoted ! if and only if:
!
The algorithm used to calculate the relative neighborhood graph of n points given by
their Cartesian coordinates is as explained below.
A
vA
uA
wA
u
v
v
u
w
v
u
V(u)
(wV)vu<m a x{wu,vw}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!34
Method
Growing Venation Structures
Step 1. Compute the distance between all pairs of point ! where
! and !.
Step 2. For each pair of points ! compute !
for ! and ! and !.
Step 3. For each pair of points ! search for a value of ! that is smaller than
!. If such point is not found, an edge is formed between ! and !.
Step 1 of this algorithm requires ! operations to yield ! pairs. Furthermore,
for each pair steps 2 and 3 require ! operations. Hence the overall complexity of this
algorithm is ! (Toussaint, 1980).
The set ! of attractors that influence node point ! consist of all attractors ! such
that ! is a relative neighbor of ! in the set ! is as follows.
!
The directions for branch development is calculated from the set ! with the method
as in the open venation algorithm.
Branches growing toward the same attractor are unlikely to reach it at the same time, so
to create anastomoses the attractor must remain active until all the branches growing
towards it have breached its kill radius. This is achieved by changing the criteria for attractor
removal, so each attractor is only removed when all the nodes who are influenced by it have
reached it. The set ! of points that are influenced by attractor ! consist of all points !
such that ! is a relative neighbor of ! in the set ! is as follows.
!"
d(pi,pj)
i,j= 1,2,....,n
ij
(pi,pj)
dkma x =m a x{d(pk,pi), d(pk,pj)}
k= 1,2,....,n
ki
kj
(pi,pj)
dkma x
d(pi,pj)
pi
pj
O(n2)
O(n2)
O(n)
O(n3)
A(p)
p
a
p
a
P{a}
A(p) = {aA|pP(a)}
A(p)
P(a)
a
p
a
p
A{p}
P(a) = {pP|aA(p)}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!35
Method
Growing Venation Structures
3.3.3 FIXING SMALL GROWTH ANOMALIES"
There were some anomalies observed, when running this algorithm with a high number
of attraction points.
One such problem was when a node is placed exactly on the midpoint of the two
attraction points that it’s attracted towards. In such a situation, their sums would cancel each
other out and the growth vector would be a zero vector. For these problems, a check is set
into place so that if the sum vector is smaller than a certain amount, only the first attraction
point will be selected to be grown towards. Thus the program never deals with a zero vector.
Another issue was in places where new nodes would either be placed in very close
proximity to existing nodes, or back-growing on top of each other. For such situations, a
proximity check is carried out, wherein the distance between the new node’s position and
nearby existing nodes’ positions are calculated (using an acceleration system explained in
section 3.6). If the distance is smaller than a certain amount, the new node isn’t added to the
next generation of nodes and the venation structure.
The last anomaly was seen at the anastomoses locations (the merging place of
branches coming together to create closed venations). As the two branch ends started to
converge and meet, the attractors pulling them together would become inactive after the
growth had breached a certain proximity to them. After this point there would be no other
force pulling them to grow towards each other and growth would die off. An interesting
observation was that the relative neighborhood graph of the nodes was particularly good at
detecting these branches and creating a neighborhood between them. As such, after the
growth had come to a stop in all sections and branch thickness calculations were complete,
a final relative neighborhood search was carried out between all the nodes. The
neighborhood connections in the final relative neighborhood graph are the branching data
used in the actual structure, as they kept all the grown branch data, and also added the
cross connections of branches almost meeting that hadn’t completely managed to merge
together.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!36
Method
Growing Venation Structures
3.4 BRANCH THICKNESS CALCULATIONS"
The final component of the venation algorithm is the calculation of the branch thickness.
Calculation begins with the assumption that all branch tips have the same initial radius !, and
proceeds basipetally, from the branch tips toward the tree base.
For this purpose, the tree structure first needs to be established, so as to know when and
where each parent branches off and into how many child branches. To this end, the parent of
each newly grown node is also stored as part of the data for that node. Once the growth
process has ended and all attractors have been reached, the parent data is checked once to
establish which nodes aren’t acting as parents for any other nodes; these would be establishes
as the branch tips. The tips are given a small initial width value. From these tips, a parent
enquiry process is used to backtrace the tip through its branches and all the way back to its
origin point. As this backtracking happens, the same amount of initial branch radius is added to
all the nodes it encounters along the way. As this procedure progresses for all branch tips, the
structure’s main supporting branches who have a higher number of tips backtracking through
them acquire a higher thickness radius.
To calculate the radius of parent branches where their children meet, Murray’s law was
employed, which states that the radii of vessels before and after a branching point in a ramifying
transport system satisfy the following formula (Runions et al., 2005).
!
Values between two to three were used for ! but a final value of ! was chosen for the
growths in this dissertation, as smaller numbers tended to create unnecessarily large main
branches. The impact of the power variable on the shape and structural performance of these
structures is something that can be further studied in later developments.
r0
rparent =p
n
i=0
rp
childi
p
p= 3
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!37
Method
Growing Venation Structures
3.5 MERGING THE OPEN AND CLOSED VENATION ALGORITHMS"
This class merges a number of the aforementioned algorithms into a controllable system to
be used by a genetic algorithm. The volume and surface meshes and support points are input,
alongside a surface to volume attractor ratio and an open vs. closed ratio, and the number of
attractors and node radius. The attractors on the surface and inside the volume are generated
based on the number of attractors required and the surface to volume attractor ratio. Then they
are distributed between the separate open and closed algorithms using random distribution and
the open vs. closed ratio. The open algorithm is initiated and run until complete, meaning all the
attractors have been reached by branches. Then the node, line and parent data of this growth is
fed into the closed algorithm and this algorithm is setup using the remaining attractors and run
until complete too. Measures have also been taken to keep the open growth parts from forming
closed structures in the final relative neighborhood graph function of the closed algorithm.
This data is then saved as a CSV format file, where the index, start and end position, and
start and end thickness of each line segment in 3D space is specified.
3.6 UNIFORM GRID ACCELERATION STRUCTURE"
As there are a large number of location and proximity checks required for both algorithms,
especially the closed venation alternative, an acceleration structure was required to reduce
calculation numbers. Since both attractor and node dispersion was fairly even throughout the
entire structure, a simple 3D uniform grid structure was selected for this acceleration. One
usage of the uniform grid in a 2D structure was studied in Toncean’s differential growth
(Toncean, 2017)
The main idea of this structure is to subdivide the scene into a uniform 3D grid of voxels,
where each grid contains a list of the nodes and attractors it encloses (Thrane and Ole
Simonsen, 2005). Two such containers were constructed, one for the attraction points, and one
for the nodes. These voxels are used wherever neighborhood or proximity searches are carried
out for either criteria, so only voxels that are up to a certain number of voxel addresses away will
be searched instead of the entire scene.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!38
Method
Growing Venation Structures
3.7 STRUCTURAL ANALYSIS"
The generated CSV file can easily be read in Grasshopper, and converted to 3D data using
a C# component. The lines are converted to Karamba beam elements, and given their circular
cross section with the desired width. As Karamba doesn’t have a method for beams to have
different widths along their length to accommodate a changing cross section, an approximation
was used in the analysis, so that the average of the start and end thicknesses was used to
create each branch’s cross section. A cylinder thickness of ! was also used for the
elements. The joint system in Karamba is assumed as stiff joints. This was hypothesized to be
used for either a 3D printed, welded or prefabricated and joined with tongue and groove joints
fabrication method.
A ! Gravity force was imposed on the entire structure and a ! force was
applied at the branch tips on the load bearing surface. After the analysis is complete, the
maximum displacement and the mass of the entire structure is output into another CSV file as
the final outcome.
3.8 GENETIC ALGORITHM AND LOOPING DATA"
As the purpose of this dissertation is to optimize grown structures, a genetic algorithm was
used to compare the structures grown in various scenarios; by keeping the mesh, support and
attractor numbers fixed, but varying the surface to volume attractor ratio and the open vs.
closed ratio. A population of 50 growths per generation was used, alongside a mutation rate of
12%. The sigmoid function indicated below was used to map the analysis data between zero
and one (En.wikipedia.org, 2018).
!
And a weight of 0.6 for displacement and 0.4 for mass was used to calculate the final
fitness value.
0.5mm
9.8m/s2
200N
S(x) = 1
1 + ex
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!39
Method
Growing Venation Structures
Data flow was looped so each venation was grown in OpenFrameworks, saved to disk,
read by Grasshopper, analyzed in Karamba, analysis saved to disk, read by OpenFrameworks
and the next venation started. After all the population is grown and analyzed, the population is
sorted and the data for the best individual of that generation and the average fitness of the
generation is written to file.
3.9 FINAL MESH"
The final line data is converted into a simple sphere and truncated cone mesh, for
fabrication purposes only. A mesh resolution and the line data are used to create a closed
triangular mesh.
3.10 SOFTWARE AND SPECIFICATIONS"
The main toolkit used for the growth and genetic algorithm part of this project is
OpenFrameworks v. 10.0 in Windows, which is written in C++, and run in Visual Studio. A few
OpenFrameworks libraries were also used for mesh importation, ray casting and CSV file
handling (Abel, 2018; Hayasaka, 2018; WrongEntertainment, 2018).
The growth data was saved to disk using a CSV format and imported into Grasshopper
which is a plug-in for the 3D modeling tool Rhinoceros. This was done to use the Karamba
plug-in (Karamba3d.com, 2018) in Grasshopper to perform finite element analysis on the
structure. The analysis done by Karamba was also saved to disk and imported into
OpenFrameworks to be analyzed and used in the genetic algorithm loop.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!40
Results
Growing Venation Structures
4. RESULTS
The genetic algorithm on the proposed structural growth system was run for 200 generations,
each consisting of 50 individuals. Each individual is setup with 500 total attractors, node size of 2,
and a volume mesh shaped as a curved funnel with a height and radius of 25m. Each structure
takes approximately 40 seconds to grow and save to disk, and each generation around 20
minutes. An example of the finished growth result is shown below.
Figure 25: structure as shown with nodes in OpenFrameworks (left) and with varying pipe radii in Rhino
(right).
The resulting analysis of the structures in Karamba ranged from 0.6 to 6.0 m in maximum
displacement and 600 to 900 kg in total mass. These range from 0.8 to 3.0 m in maximum
displacement and from 570 to 650 kg in total mass for each generation’s fittest individual.
A graph of the data for each generation of the genetic algorithm, including average fitness,
best fitness, and the level of openness and surface vs. volume population for the fittest individual is
shown below.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!41
Results
Growing Venation Structures
Figure 26: Graph of 200 iterations of the genetic algorithm with a population of 50 individuals.
Based on this data, the average fitness of the population increased with GA iterations yet the
best fitness did not change much. This might be a result of the fitness algorithm, and the fact that
the mapping sequence should have mapped data with the sigmoid function to a wider range. It
could also be an indicator that there might not necessarily be a link between the changing factors
and the resulting analysis.
Yet this probably can’t be the reason, since there is a definite correlation between fitness and
surface vs. volume population. The range of 85-90% seems to yield the best results in this test.
However the level of openness jumps around significantly, varying between 28-70% in the fittest
individuals. This might be a result of the higher fitness weight of the openness and can be further
looked into by changing the weight ratios in further studies.
The best results seems to be yielded with a high (80-90%) surface to volume population ratio
and and mid-low (30-60%) percentages for openness values. The fitness of the fittest of these
individuals ranges between 90-95% in the current criteria evaluations, with an average population
fitness of 70-80%. This lower amount is mostly due to the 12% mutation rate in the genotype
crossover algorithm.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!42
Results
Growing Venation Structures
Figure 27: Graph of population fitness over one generation.
4.1 LIMITATIONS"
The current system showed several limitations in order to facilitate future application in real-
world situations.
4.1.1 LEVEL OF DETAIL IN THE STRUCTURE"
As the time required to generate each individual was so high, a higher resolution
structure needing a higher number of attractors and lower node sizes could not be explored
using the current hardware. They would require a large amount of time to reach conclusions
and the number of computations required might exceed the power of the current hardware.
4.1.2 THE RANGE OF RESULTS"
These are mainly due to the high time requirement for the generation and assessment of
the structures.
4.1.3 INTERACTION WITH THE GENETIC ALGORITHM PARAMETERS WHILST
RUNNING"
As the time required for results to become evident was very high, and not yet explored,
this feature was not looked into in the development of the current system but would be
helpful in narrowing down reasons for the results.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!43
Results
Growing Venation Structures
4.1.4 STRUCTURAL ANALYSIS DATA"
The current resulting analysis only takes into account the maximum displacement and
total mass of the system. This might be too general and need further detailed analysis of the
component parts (e.g. displacement and resulting forces in each area and their mass). This
data would be accessible if full versions the FEA program Karamba were used as well (the
free version is implemented here).
4.2 OVERALL ASSESSMENT"
The conducted experiment shows the great potential of using a space colonization system
combining open and closed form growths to create required structures. Displacements usually in
the range of 1-2m in a 25m high structure are an initial positive result. And these can be further
reduced by increasing resolution and detail definition in the final structure in further developments.
In contrast, it showed the relatively high computational demand in terms of required power
and time for numerous calculations. Moreover, as the main focus at this point was on creating a
controllable hybrid system to merge two existing systems to answer a bigger problem, higher
optimizations were not included as a main interest at this stage. However, the time criteria did have
a vital impact on the range of acquired results at the current stage, and could have provided the
research with further insights if more experiments could have been conducted during the same
amount of time. Also factors like the type of material, scale, joints and connections were not
included as a a factor of interest at this stage.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!44
Conclusion
Growing Venation Structures
5. CONCLUSION
The purpose of this dissertation was to research, design and analyze an interactive organic
structural system that merges the wider variety and design options available with open ended
growth in natural habitats with the stable closed forms most commonly found in current
construction structures. For that purpose a space colonization venation structure system was
designed that would be able to create, assess and attempt to optimize the growth data and
generate better results in structural performance and material optimization.
The proposed system manages to converge both types of growth into a hybrid system that
can be partially controlled by input parameters, and is partially indeterminate and organic in its
form. This balance between determinism and indeterminism allowed for a structure that can have
one support base and bear a number of loads that are dispersed in space. This is something that
neither organic forms, nor current construction norms allow. It allows for an intuitive placement of
the structure based on iterations and optimizes material use. The convergence of parametric and
organic in this system also influences the designer’s role and interaction with the final form, both
structurally and aesthetically.
The system takes note of features including desired structure formation volume, areas of load
bearing functionality, areas of structural support, and the level of micro-structuring based on
attractor numbers and node radius. It can also be modified by means of the fitness criteria and
thickness assignment algorithms. These criteria give the user a wide array of options to affect and
modify the system based on requirements. The structural performance information of each
structure becomes available to the user after its conception (There would also be a wider array of
data available as fitness criteria if a full version of the Karamba software was implemented). This
data assesses and affects the next generation of growths and their initial conditions to affect their
performance. These conditions can be seen to converge in at least one of the criteria and to some
extent in the other. This definitely indicates the effectiveness of the proposed system to optimize
their future venations and create more effective forms. On a side note, it must be noted that this is
just an initial step in attempting to assess the hybrid structures conceptualized.
However the computational efficiency of proximity searches and their counts are not yet at
their highest at this point. Increasing this efficiency can noticeably affect the range of data
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!45
Conclusion
Growing Venation Structures
collection, as it would enable growths of much larger and intricate structures with the same
hardware that would undoubtedly perform better.
5.1 FUTURE RESEARCH"
5.1.1 OPTIMIZATION"
The slowest and most computationally heavy part of the algorithm was the relative
neighborhood graph at the end, used to create anastomosis and merge close connections,
although the closed venation growth was also heavy, even with the mentioned optimizations
implemented. Further proximity optimizations that would benefit the current algorithm are a
field that can be researched in further developments. Another field in terms of speed
optimization could be to import or translate a finite element analysis library into the
OpenFrameworks C++ environment to remove the need for constant file read and writes and
application interactions to speed up the process even more, as a C++ library for FEA was
not found at the time of this research.
5.1.2 EXPANDING THE DATA RANGE"
As mentioned, the high computational time did not allow for more experimentation here.
Yet there are an array of parameters that can be looked into to fine tune and further optimize
the current system. These include but are not limited to: mesh shape and load placement,
number of attractors, node radius which would define the resolution and level of detail in the
structure, the relation between parent branch thickness in relation to its children which could
noticeably affect structural performance based on loads, amount, area and direction of load
placement, number, location and type of support placement, and structural joint type.
5.1.3 FITNESS CRITERIA"
Another area that can be further researched to analyze the results would be the fitness
criteria and their mapping structure. And how these can be interactively changed to
accommodate the current range of results or even be changeable by the user during the
genetic algorithm running process (as these were static in the current system).
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!46
Conclusion
Growing Venation Structures
5.1.4 EXPANDING STRUCTURAL ANALYSIS"
Also as the current analysis results were very limited, this area can be greatly expanded
to look into a more detailed structural analysis in terms of data (displacement, deflection,
resultant forces), localization (analyzing the data in each local area as opposed to a total
displacement or force value), and even local optimization (affecting the growth amount and
detail in each area, based on structural requirements or performance of previous results,
using attractor generation, growth type (open vs. closed), detail (node radius), and even
thickness assignment to that region.
5.1.5 STRUCTURE DETAIL REFINEMENT"
Finer detail refinements are another area that can be expanded in future works. Issues
such as lone terminal branches as an unwanted negative byproduct of volume population in
some locations, and repeated branch creations between branches that are parallel or close
to parallel to each other in the final relative neighborhood graph assessment can be resolved
to increase the efficiency and performance of the overall system.
5.1.6 CONSTRUCTION AND FABRICATION"
Finally, methods to convert the current structure into a buildable 1:1 architectural
structure including fabrication, joint, and structure attachment details can be further
developed in order to facilitate future real-world application and construction.
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!47
References
Growing Venation Structures
6. REFERENCES
Abel, J. (2018). ofxAssimpModelLoader. [online] GitHub. Available at: https://github.com/
jeremyabel/ofxAssimpModelLoader [Accessed 14 Jul. 2018].
Bathe, K. (2014). Finite Element Procedures. 1st ed. Watertown, MA: Klaus-Jurgen Bathe, pp.
1-2.
Bhooshan, V., Fuchs, M. and Bhooshan, S. (2017). 3D-Printing, Topology Optimization and
Statistical Learning: A Case Study."Conference: Symposium on Simulation for Architecture and
Urban Design, [online] p.1. Available at: https://www.researchgate.net/publication/317623948_3D-
Printing_Topology_Optimization_and_Statistical_Learning_A_Case_Study [Accessed 3 Jun. 2018].
Dermid, J. (2018)."Science Source - Leaf venation. [online] Sciencesource.com. Available at:
https://www.sciencesource.com/archive/Leaf-venation-SS2111480.html [Accessed 26 Aug.
2018].
En.wikipedia.org. (2018). Sigmoid Function. [online] Available at: https://en.wikipedia.org/wiki/
Sigmoid_function [Accessed 27 Jul. 2018].
Flake, G. (1998),"The Computational Beauty of Nature: Computer Explorations of Fractals,
Chaos, Complex Systems and Adaptation. Cambridge, MA.: MIT Press, pp.78-79, 81.
Hayasaka, Akira."“ofxRayTriangleIntersection" [online] Available at: https://github.com/Akira-
Hayasaka/ofxRayTriangleIntersection [Accessed 27 Jul. 2018].
Kaandorp, J. and Kübler, J. (2001), "The Algorithmic Beauty of Seaweeds, Sponges and
Corals, Berlin, Germany: Springer-Verlag Berlin Heidelberg, pp.1, 109-110, 113, 125, 130-131.
Karamba3d.com. (2018). Karamba3D – parametric engineering. [online] Available at: https://
www.karamba3d.com/ [Accessed 20 Jun. 2018].
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!48
References
Growing Venation Structures
Louis-Rosenberg, J. (2015). Floraform: An Exploration of Differential Growth. [online] Nervous
System. Available at: https://n-e-r-v-o-u-s.com/blog/?p=6721 [Accessed 3 Apr. 2018].
Modlen, G. (2008). Introduction to Finite Element Analysis. Manchester: The University of
Manchester, pp.1-3.
Preisinger, C. (2012). Karamba3D: User Manual for Version 0.9.084. [ebook] p.6. Available at:
https://www.karamba3d.com/wp-content/uploads/downloads/2012/04/
KarambaManual_0_9_084.pdf [Accessed 20 Jun. 2018].
Prusinkiewicz, P. and Lindenmayer, A. (1990),"The Algorithmic Beauty of Plants. New York, NY:
Springer-Verlag New York, p.60.
Roberts, J. (2001). Sticky Pixels: Evolutionary Growth by Random Drop Ballistic Aggregation.
Eurographics UK 2001 Conference Proceedings, [online] pp.1, 3, 7. Available at: https://
kar.kent.ac.uk/id/eprint/13627 [Accessed 30 Apr. 2018].
Rodkaew, Y., Siripant, S., Lursinsap, C. and CHongstitvatana, P. (2002). An Algorithm for
Generating Vein Images for Realistic Modeling of a Leaf. pp.3, 6.
Runions, A., Fuhrer, M., Lane, B., Federl, P., Rolland-Lagan, A. and Prusinkiewicz, P. (2005).
Modeling and visualization of leaf venation patterns."ACM Transactions on Graphics, 24(3), pp. 4-6.
Runions, A., Lane, B. and Prusinkiewicz, P. (2007). Modeling Trees with a Space Colonization
Algorithm, pp. 2-4.
Thrane, N. and Ole Simonsen, L. (2005)."A Comparison of Acceleration Structures for GPU
Assisted Ray Tracing. Post Graduate. The Department of Computer Science, Aarhus University.
"Toncean, A. (2017)."Real-time differential growth in JavaScript. [online] adrianton3.github.io.
Available at: http://adrianton3.github.io/blog/art/differential-growth/differential-growth.html
[Accessed 2 Jul. 2018].
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!49
References
Growing Venation Structures
Toussaint, G. (1980). The Relative Neighborhood Graph of a Finite Planar Set."Pattern
Recognition, [online] 12(4), pp.261-268. Available at: https://www.sciencedirect.com/science/
article/pii/0031320380900667.
Weisstein, Eric W.""Triangle Area." From"MathWorld--A Wolfram Web Resource. [online]
Available at: http://mathworld.wolfram.com/TriangleArea.html [Accessed 7 Aug. 2018a].
Weisstein, Eric W.""Triangle Point Picking." From"MathWorld--A Wolfram Web Resource.
[online] Available at: http://mathworld.wolfram.com/TrianglePointPicking.html [Accessed 7 Aug.
2018b].
WrongEntertainment. (2018). ofxCsv. [online] GitHub. Available at: https://github.com/
WrongEntertainment/ofxCsv [Accessed 29 Jul. 2018].
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!50
Appendices
Growing Venation Structures
7. APPENDICES
APPENDIX A: MERGING VENATIONS PSEUDO-CODE"
// SETUP
void Venation3D::setup(int _noOfAttractors, int _nodeRadius, float _degreeOfOpenness, float _ratioForSurface, int _number)
{
nodeRadius = _nodeRadius;
number = _number;
degreeOfOpenness = _degreeOfOpenness;
ratioForSurface = _ratioForSurface;
saved = false;
switchGrowth = true;
// geometry
ofxAssimpModelLoader geometry;
ofMesh geometryMesh;
ofxAssimpModelLoader surface;
ofMesh surfaceMesh;
geometry.loadModel("Test 3 - Geometry.obj");
geometryMesh = geometry.getMesh(0);
surface.loadModel("Test 3 - Surface.obj");
surfaceMesh = surface.getMesh(0);
vector <ofVec3f> points;
// get bounding box
minX = std::numeric_limits<float>::max();
maxX = - std::numeric_limits<float>::max();
minY = std::numeric_limits<float>::max();
maxY = - std::numeric_limits<float>::max();
minZ = std::numeric_limits<float>::max();
maxZ = - std::numeric_limits<float>::max();
auto verts = geometryMesh.getVertices();
for (int i = 0; i < verts.size(); i++)
{
auto v = verts[i];
if(v.x < minX) minX = v.x;
if(v.x > maxX) maxX = v.x;
if(v.y < minY) minY = v.y;
if(v.y > maxY) maxY = v.y;
if(v.z < minZ) minZ = v.z;
if(v.z > maxZ) maxZ = v.z;
}
// raycasting
ofxRayTriangleIntersection rtIntersect;
vector <FaceTri> tris;
vector <Ray> rays;
vector <ofVec3f> pIn;
vector <ofVec3f> pOut;
// input mesh faces
tris.clear();
for (int i = 0; i < geometryMesh.getUniqueFaces().size(); i++)
{
auto face = geometryMesh.getFace(i);
FaceTri tri;
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!51
Appendices
Growing Venation Structures
auto v = face.getVertex(0);
tri.v0 = ofPoint(v.x, v.y, v.z);
v = face.getVertex(1);
tri.v1 = ofPoint(v.x, v.y, v.z);
v = face.getVertex(2);
tri.v2 = ofPoint(v.x, v.y, v.z);
tris.push_back(tri);
}
// surface population
int num = _noOfAttractors * ratioForSurface;
float totalArea = 0;
vector <float> areas;
areas.clear();
areas.resize(surfaceMesh.getUniqueFaces().size());
// 1. area calculation
for (int i = 0; i < areas.size(); i++)
{
auto face = surfaceMesh.getFace(i);
auto a = face.getVertex(0);
auto b = face.getVertex(1);
auto c = face.getVertex(2);
ofVec3f ab = b - a;
ofVec3f bc = c - b;
float cAngle = ab.angleRad(bc);
float area = 0.5 * ab.length() * bc.length() * sin(cAngle);
totalArea += area;
areas[i] = area;
}
// 2. point distribution
for (int i = 0; i < areas.size(); i++)
{
int triNum = round(num * areas[i] / totalArea);
auto face = surfaceMesh.getFace(i);
auto a = face.getVertex(0);
auto b = face.getVertex(1);
auto c = face.getVertex(2);
ofVec3f ba = a - b;
ofVec3f bc = c - b;
for (int j = 0; j < triNum; j++)
{
float baVar = ofRandom(1.0);
float bcVar = ofRandom(1.0);
// if they go outside the triangle and into the quadrilateral
if (baVar + bcVar > 1.0)
{
float baTemp = baVar;
baVar = 1 - bcVar;
bcVar = 1 - baTemp;
}
ofVec3f p = baVar * ba + bcVar * bc;
p += b;
if (ofRandom(1.0) < degreeOfOpenness) openAttractors.push_back(p);
else closedAttractors.push_back(p);
}
}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!52
Appendices
Growing Venation Structures
// volume population
while (openAttractors.size() + closedAttractors.size() < _noOfAttractors)
{
rays.clear();
float x = ofRandom(minX, maxX);
float y = ofRandom(minY, maxY);
float z = ofRandom(minZ, maxZ);
ofVec3f dir = ofVec3f(ofRandom(1.0), ofRandom(1.0), ofRandom(1.0));
dir.normalize();
dir *= (maxX - minX) + (maxY - minY) + (maxZ - minZ);
Ray ray;
ray.rayOrig.set(x, y, z);
ray.rayEnd.set(x + dir.x, y + dir.y, z + dir.z);
rays.push_back(ray);
auto results = rtIntersect.checkMeshIntersection(rays, tris);
if (results.size() % 2 == 1)
{
if (ofRandom(1.0) < _degreeOfOpenness) openAttractors.push_back(ofVec3f(x, y, z));
else closedAttractors.push_back(ofVec3f(x, y, z));
}
}
vector <ofVec3f> openOrigins;
openOrigins.clear();
openOrigins.push_back(ofVec3f(0, 0, 0));
vOpen.setup(openAttractors, openOrigins, nodeRadius);
}
// UPDATE
void Venation3D::update()
{
if (!vOpen.done()) vOpen.update();
else if (switchGrowth)
{
vClosed.setup(closedAttractors, vOpen.getNodes(), vOpen.getLines(),vOpen.getParents(),
nodeRadius, minX, maxX, minY, maxY, minZ, maxZ);
switchGrowth = false;
}
else vClosed.update();
if (vClosed.done() && !saved)
{
vClosed.saveFile(number, degreeOfOpenness, ratioForSurface);
saved = true;
}
}
// DRAW
void Venation3D::draw()
{
if (!vOpen.done()) vOpen.draw();
else vClosed.draw();
}
bool Venation3D::done()
{
#return saved;
}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!53
Appendices
Growing Venation Structures
APPENDIX B: OPEN VENATION PSEUDO-CODE"
// SETUP
void Venation3DOpen::setup(vector <ofVec3f> _attractors, vector <ofVec3f> _originNodes, int _nodeRadius)
{
nodeRadius = _nodeRadius;
finalize = true;
// setting starting Point
for (int i = 0; i < _originNodes.size(); i++)
{
nodes.push_back(_originNodes[i]);
nodeParents.push_back(-1);
}
// setting attraction points
for (int i = 0; i < _attractors.size(); i++)
attractors.push_back(_attractors[i]);
}
// UPDATE
void Venation3DOpen::update()
{
attractorCheck();
generateProximity();
generateNewNodes();
if (attractors.empty() && finalize)
{
calculateThickness();
finalize = false;
}
}
// DRAW
void Venation3DOpen::draw()
{
// draw leaf
if (leafRadius > 0)
{
ofNoFill();
ofSetColor(200, 100);
ofDrawSphere(0, 0, leafRadius);
}
// draw tree lines
ofPushStyle();
ofSetLineWidth(5);
ofSetColor(0, 200, 200);
for (int i = 0; i < lines.size(); i++)
ofDrawLine(nodes[lines[i][0]].x, nodes[lines[i][0]].y, nodes[lines[i][0]].z, nodes[lines[i][1]].x, nodes[lines[i][1]].y, nodes[lines[i][1]].z);
ofPopStyle();
// draw attractor lines
ofSetColor(0, 100, 255);
for (int i = 0; i < nodeClosestPoints.size(); i++)
for (int j = 0; j < nodeClosestPoints[i].size(); j++)
ofDrawLine(nodes[i].x, nodes[i].y, nodes[i].z, attractors[nodeClosestPoints[i][j]].x, attractors[nodeClosestPoints[i][j]].y,
attractors[nodeClosestPoints[i][j]].z);
// draw attraction points
ofFill();
ofSetColor(255, 150, 150);
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!54
Appendices
Growing Venation Structures
for (int i = 0; i < attractors.size(); i++) ofDrawSphere(attractors[i].x, attractors[i].y, attractors[i].z, nodeRadius);
// draw nodes
for (int i = 0; i < nodes.size(); i++)
{
float r = (nodeThickness.size() > 0) ? nodeThickness[i]: nodeRadius;
ofFill();
ofSetColor(0, 255, 255);
ofDrawSphere(nodes[i].x, nodes[i].y, nodes[i].z, r);
// drawing the branch tips
ofNoFill();
ofSetColor(255);
if (hasChildren.size() > 0)
if (!hasChildren[i])
ofDrawSphere(nodes[i].x, nodes[i].y, nodes[i].z, r);
}
}
// CHECKING FINISHED STATUS
bool Venation3DOpen::done()
{
if (nodeThickness.size() > 0) return true;
else return false;
}
// EXTRACTING NODE DATA
vector <ofVec3f> Venation3DOpen::getNodes()
{
return nodes;
}
// EXTRACTING LINE DATA
vector <vector <int>> Venation3DOpen::getLines()
{
return lines;
}
// EXTRACTING PARENTAGE DATA
vector <int> Venation3DOpen::getParents()
{
return nodeParents;
}
// CHECKING ATTRACTORS FOR REACHED STATUS
void Venation3DOpen::attractorCheck()
{
float attractorDist = 0;
for (int i = attractors.size() - 1; i >= 0 ; i--)
for (int j = newNodesIndex; j < nodes.size(); j++)
{
attractorDist = ofDist(attractors[i].x, attractors[i].y, attractors[i].z, nodes[j].x, nodes[j].y, nodes[j].z);
if (attractorDist < nodeRadius * 2)
{
attractors.erase(attractors.begin() + i);
break;
}
}
}
void Venation3DOpen::generateProximity()
{
nodeClosestPoints.clear();
nodeClosestPoints.resize(nodes.size());
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!55
Appendices
Growing Venation Structures
float dist = 0;
float tempDist = 0;
int index = 0;
for (int i = 0; i < attractors.size(); i++)
{
dist = FLT_MAX;
index = 0;
for (int j = 0; j < nodes.size(); j++)
{
tempDist = ofDist(attractors[i].x, attractors[i].y, attractors[i].z, nodes[j].x, nodes[j].y, nodes[j].z);
if (tempDist < dist)
{
dist = tempDist;
index = j;
}
}
nodeClosestPoints[index].push_back(i);
}
}
// NEW NODE GENERATION
void Venation3DOpen::generateNewNodes()
{
newNodesIndex = nodes.size();
vector <ofVec3f> newNodes;
ofVec3f newNode;
ofVec3f attractorNode;
vector <int> newLine;
int n = nodes.size();
for (int i = 0 ; i < n; i++)
{
newNode.set(0, 0, 0);
int nodeAttractorSize = nodeClosestPoints[i].size();
if (nodeAttractorSize > 0)
{
newLine.push_back(i);
for (int j = 0; j < nodeAttractorSize; j++)
{
attractorNode = attractors[nodeClosestPoints[i][j]] - nodes[i];
attractorNode.normalize();
newNode += attractorNode;
}
if (newNode.length() < nodeRadius * 0.5) newNode = attractorNode;
newNode.normalize();
newNode *= nodeRadius * 2;
newNode += nodes[i];
newLine.push_back(nodes.size());
lines.push_back(newLine);
nodes.push_back(newNode);
nodeParents.push_back(i);
newLine.clear();
}
}
}
// THICKNESS CALCULATION
void Venation3DOpen::calculateThickness()
{
// calculating end notes (without children)
hasChildren.resize(nodes.size(), false);
for (int i = 0; i < nodes.size(); i++)
if (nodeParents[i] > -1)
hasChildren[nodeParents[i]] = true;
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!56
Appendices
Growing Venation Structures
// calculating each node's thickness
nodeThickness.resize(nodes.size(), 0);
for (int i = 0; i < nodes.size(); i++)
if (!hasChildren[i])
{
int index = i;
while (index > -1)
{
nodeThickness[index]++;
index = nodeParents[index];
}
}
for (int i = 0; i < nodes.size(); i++)
nodeThickness[i] = pow(nodeThickness[i], 1.0 / 2.4);
}
APPENDIX C: CLOSED VENATION PSEUDO-CODE"
// SETUP
void Venation3DClosed::setup(vector <ofVec3f> _attractors, vector <ofVec3f> _nodes, vector <vector <int>> _lines, vector <int>
_nodeParents, int _nodeRadius, float _minX, float _maxX, float _minY, float _maxY, float _minZ, float _maxZ)
{
progressCounter = 0;
nodeRadius = _nodeRadius;
initial = true;
finalize = true;
minX = _minX;
minY = _minY;
minZ = _minZ;
maxX = _maxX;
maxY = _maxY;
maxZ = _maxZ;
// setting up the container size
float volume = (maxX - minX) * (maxY - minY) * (maxZ - minZ);
containerNum = _attractors.size() / 6.0;
containerLength = cbrt(volume / containerNum);
containerNumX = ceil((maxX - minX) / containerLength + 0.001);
containerNumY = ceil((maxY - minY) / containerLength + 0.001);
containerNumZ = ceil((maxZ - minZ) / containerLength + 0.001);
containerDist = containerLength * 2.0; // change if more dispersed
// setting up attractor containers
containersAttractors.resize(containerNumX);
for (int i = 0; i < containersAttractors.size(); i++)
{
containersAttractors[i].resize(containerNumY);
for (int j = 0; j < containersAttractors[i].size(); j++)
containersAttractors[i][j].resize(containerNumZ);
}
// setting attraction points
for (int i = 0; i < _attractors.size(); i++)
{
// checking position of new attractor
int nodeX = floor(ofMap(_attractors[i].x, minX, minX + containerNumX * containerLength, 0, containerNumX));
int nodeY = floor(ofMap(_attractors[i].y, minY, minY + containerNumY * containerLength, 0, containerNumY));
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!57
Appendices
Growing Venation Structures
int nodeZ = floor(ofMap(_attractors[i].z, minZ, minZ + containerNumZ * containerLength, 0, containerNumZ));
##if (nodeX < 0) nodeX = 0;
##if (nodeY < 0) nodeY = 0;
##if (nodeZ < 0) nodeZ = 0;
##if (nodeX > containerNumX - 1) nodeX = containerNumX - 1;
##if (nodeY > containerNumY - 1) nodeY = containerNumY - 1;
##if (nodeZ > containerNumZ - 1) nodeZ = containerNumZ - 1;
containersAttractors[nodeX][nodeY][nodeZ].push_back(i);
attractorIndices.push_back(i);
attractors.push_back(_attractors[i]);
attractorContainer.push_back(vector <int> {nodeX, nodeY, nodeZ});
}
// setting up containers
containers.resize(containerNumX);
for (int i = 0; i < containers.size(); i++)
{
containers[i].resize(containerNumY);
for (int j = 0; j < containers[i].size(); j++)
containers[i][j].resize(containerNumZ);
}
// putting initial nodes into containers
for (int i = 0; i < _nodes.size(); i++)
{
nodes.push_back(_nodes[i]);
nodeParents.push_back(_nodeParents[i]);
int nodeX = floor(ofMap(nodes[i].x, minX, minX + containerNumX * containerLength, 0, containerNumX));
int nodeY = floor(ofMap(nodes[i].y, minY, minY + containerNumY * containerLength, 0, containerNumY));
int nodeZ = floor(ofMap(nodes[i].z, minZ, minZ + containerNumZ * containerLength, 0, containerNumZ));
##if (nodeX < 0) nodeX = 0;
##if (nodeY < 0) nodeY = 0;
##if (nodeZ < 0) nodeZ = 0;
##if (nodeX > containerNumX - 1) nodeX = containerNumX - 1;
##if (nodeY > containerNumY - 1) nodeY = containerNumY - 1;
##if (nodeZ > containerNumZ - 1) nodeZ = containerNumZ - 1;
containers[nodeX][nodeY][nodeZ].push_back(i);
nodeContainer.push_back(vector <int> {nodeX, nodeY, nodeZ});
}
for (int i = 0; i < _lines.size(); i++)
lines.push_back(_lines[i]);
initialNodesSize = nodes.size();
initialLinesSize = lines.size();
}
// UPDATE
void Venation3DClosed::update()
{
if (!initial) attractorCheck();
if (progressCounter % 5 == 0) nodePassedCheck();
generateRng();
generateNewNodes();
if (attractors.empty() && finalize)
{
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!58
Appendices
Growing Venation Structures
calculateThickness();
finalRngStructure();
finalize = false;
}
initial = false;
progressCounter++;
}
// DRAW
void Venation3DClosed::draw()
{
// draw containers
ofSetColor(50);
for (int i = 0; i <= containerNumX; i++)
for (int j = 0; j <= containerNumY; j++)
for (int k = 0; k <= containerNumZ; k++)
{
float x = i * containerLength;
float y = j * containerLength;
float z = k * containerLength;
float X = containerNumX * containerLength;
float Y = containerNumY * containerLength;
float Z = containerNumZ * containerLength;
ofDrawLine(x + minX, y + minY, minZ, x + minX, y + minY, Z + minZ);
ofDrawLine(x + minX, minY, z + minZ, x + minX, Y + minY, z + minZ);
ofDrawLine( minX, y + minY, z + minZ, X + minX, y + minY, z + minZ);
}
// draw leaf
ofNoFill();
ofSetColor(200);
ofDrawSphere(0, 0, 0, leafRadius);
// draw attractors
ofFill();
ofSetColor(255, 150, 150);
for (int i = 0; i < attractors.size(); i++) ofDrawSphere(attractors[i].x, attractors[i].y, attractors[i].z, nodeRadius);
// draw nodes (colors based on placement in containers (R for X, G for Y, B for Z))
for (int i = 0; i < containers.size(); i++)
for (int j = 0; j < containers[i].size(); j++)
for (int k = 0; k < containers[i][j].size(); k++)
if (!containers[i][j][k].empty())
for (int n = 0; n < containers[i][j][k].size(); n++)
{
int index = containers[i][j][k][n];
double r = (nodeThickness.size() > 0) ? nodeThickness[index]: nodeRadius;
ofFill();
ofSetColor((255 / containers.size()) * i, (255 / containers[i].size()) * j, (255 / containers[i][j].size()) * k);
ofDrawSphere(nodes[index].x, nodes[index].y, nodes[index].z, r);
}
// draw tree lines (with thickness at the end)
ofPushStyle();
ofSetColor(0, 255, 255, 150);
ofSetLineWidth(4);
if (finalLines.size() > 0)
for (int i = 0; i < finalLines.size(); i++)
{
ofVec3f a = nodes[finalLines[i][0]];
ofVec3f b = nodes[finalLines[i][1]];
float w = (nodeThickness[finalLines[i][0]] + nodeThickness[finalLines[i][1]]) / 2.0;
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!59
Appendices
Growing Venation Structures
ofSetLineWidth(w);
ofDrawLine(a.x, a.y, a.z, b.x, b.y, b.z);
}
else
for (int i = 0; i < lines.size(); i++)
{
if (i < newLinesIndex) ofSetColor(0, 0, 255, 150);
else ofSetColor(255, 0, 0, 100);
ofVec3f a = nodes[lines[i][0]];
ofVec3f b = nodes[lines[i][1]];
ofDrawLine(a.x, a.y, a.z, b.x, b.y, b.z);
}
ofPopStyle();
//draw RNG growth lines
ofSetLineWidth(1);
ofSetColor(255, 255, 0);
if (nodeNeighbors.size() > 0)
for (int i = 0; i < nodeNeighbors.size(); i++)
if (nodeNeighbors[i].size() > 0)
for (int j = 0; j < nodeNeighbors[i].size(); j++)
ofDrawLine(nodes[i].x, nodes[i].y, nodes[i].z, attractors[nodeNeighbors[i][j]].x, attractors[nodeNeighbors[i][j]].y,
attractors[nodeNeighbors[i][j]].z);
}
// CHECKING FINISHED STATUS
bool Venation3DClosed::done()
{
if (nodeThickness.size() > 0) return true;
else return false;
}
// CHECKING ATTRACTORS FOR REACHED STATUS
void Venation3DClosed::attractorCheck()
{
float attractorDist = 0;
for (int i = attractors.size() - 1; i >= 0 ; i--)
{
bool deleteAttractor = true;
int attractorNeighborSize = attractorNeighbors[i].size();
if (attractorNeighborSize > 0)
for (int j = 0; j < attractorNeighborSize; j++)
{
int neighbor = attractorNeighbors[i][j];
attractorDist = ofDist(attractors[i].x, attractors[i].y, attractors[i].z, nodes[neighbor].x, nodes[neighbor].y, nodes[neighbor].z);
if (attractorDist > nodeRadius * 4)
{
deleteAttractor = false;
break;
}
}
else deleteAttractor = false;
if (deleteAttractor)
{
int attractorX = attractorContainer[attractorIndices[i]][0];
int attractorY = attractorContainer[attractorIndices[i]][1];
int attractorZ = attractorContainer[attractorIndices[i]][2];
containersAttractors[attractorX][attractorY][attractorZ].erase(remove(containersAttractors[attractorX][attractorY]
[attractorZ].begin(), containersAttractors[attractorX][attractorY][attractorZ].end(), attractorIndices[i]), containersAttractors[attractorX]
[attractorY][attractorZ].end());
attractorIndices.erase(attractorIndices.begin() + i);
attractors.erase(attractors.begin() + i);
}
}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!60
Appendices
Growing Venation Structures
}
void Venation3DClosed::nodePassedCheck()
{
for (int mei = 0; mei < containerNumX; mei++)
for (int mej = 0; mej < containerNumY; mej++)
for (int mek = 0; mek < containerNumZ; mek++)
if (!(find(passedContainers.begin(), passedContainers.end(), vector <int> {mei, mej, mek}) != passedContainers.end()))
{
bool passed = true;
for (int i = mei - 1; i <= mei + 1; i++)
if (passed)
for (int j = mej - 1; j <= mej + 1; j++)
if (passed)
for (int k = mek - 1; k <= mek + 1; k++)
if (passed)
if (i >= 0 && i < containers.size() && j >= 0 && j < containers[i].size() && k >= 0 && k < containers[i][j].size())
if (containersAttractors[i][j][k].size() > 0) passed = false;
if (passed)
{
passedContainers.push_back(vector <int> {mei, mej, mek});
for (int n = 0; n < containers[mei][mej][mek].size(); n++)
passedNodes.push_back(containers[mei][mej][mek][n]);
}
}
}
// GENERATING RELATIVE NEIGHBORHOOD GRAPHS
void Venation3DClosed::generateRng()
{
rngSize = nodes.size() + attractors.size();
int nSize = nodes.size();
int aSize = attractors.size();
nodeNeighbors.clear();
nodeNeighbors.resize(nodes.size());
attractorNeighbors.clear();
attractorNeighbors.resize(attractors.size());
// getting max distances for each pair
for (int i = 0; i < nSize; i++)
if (!(find(passedNodes.begin(), passedNodes.end(), i) != passedNodes.end()))
for (int j = 0; j < aSize; j++)
{
bool relativeNeighborhood = true;
float ijDist = ofDist(nodes[i].x, nodes[i].y, nodes[i].z, attractors[j].x, attractors[j].y, attractors[j].z);
int nodeX = nodeContainer[i][0];
int nodeY = nodeContainer[i][1];
int nodeZ = nodeContainer[i][2];
int attractorX = attractorContainer[j][0];
int attractorY = attractorContainer[j][1];
int attractorZ = attractorContainer[j][2];
if (abs(nodeX - attractorX) < containerDist && abs(nodeY - attractorY) < containerDist && abs(nodeZ - attractorZ) <
containerDist)
{
for (int k = 0; k < nSize + aSize; k++)
if (i != k && j + nSize != k)
{
float ikDist;
float jkDist;
if (k < nSize)
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!61
Appendices
Growing Venation Structures
{
ikDist = ofDist(nodes[i].x, nodes[i].y, nodes[i].z, nodes[k].x, nodes[k].y, nodes[k].z);
jkDist = ofDist(attractors[j].x, attractors[j].y, attractors[j].z, nodes[k].x, nodes[k].y, nodes[k].z);
}
else
{
ikDist = ofDist(nodes[i].x, nodes[i].y, nodes[i].z, attractors[k - nSize].x, attractors[k - nSize].y, attractors[k - nSize].z);
jkDist = ofDist(attractors[j].x, attractors[j].y, attractors[j].z, attractors[k - nSize].x, attractors[k - nSize].y, attractors[k -
nSize].z);
}
float maxDist = max(ikDist, jkDist);
// checking if there is a distance smaller than the pair distance
if (maxDist < ijDist)
{
relativeNeighborhood = false;
break;
}
}
}
else relativeNeighborhood = false;
if (relativeNeighborhood)
{
nodeNeighbors[i].push_back(j);
attractorNeighbors[j].push_back(i);
}
}
}
// GENEATING NEW NODES
void Venation3DClosed::generateNewNodes()
{
newLinesIndex = lines.size();
vector <ofVec3f> newNodes;
ofVec3f newNode;
ofVec3f attractionDist;
vector <int> newLine;
int n = nodes.size();
for (int i = 0 ; i < n; i++)
{
newNode.set(0, 0, 0);
int nodeAttractorSize = nodeNeighbors[i].size();
if (nodeAttractorSize > 0)
{
newLine.push_back(i);
for (int j = 0; j < nodeAttractorSize; j++)
{
attractionDist = attractors[nodeNeighbors[i][j]] - nodes[i];
attractionDist.normalize();
newNode += attractionDist;
}
if (newNode.length() < nodeRadius * 0.5) newNode = attractionDist;
newNode.normalize();
newNode *= nodeRadius * 2;
newNode += nodes[i];
int nodeX = floor(ofMap(newNode.x, minX, minX + containerNumX * containerLength, 0, containerNumX));
int nodeY = floor(ofMap(newNode.y, minY, minY + containerNumY * containerLength, 0, containerNumY));
int nodeZ = floor(ofMap(newNode.z, minZ, minZ + containerNumZ * containerLength, 0, containerNumZ));
###if (nodeX < 0) nodeX = 0;
###if (nodeY < 0) nodeY = 0;
###if (nodeZ < 0) nodeZ = 0;
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!62
Appendices
Growing Venation Structures
###if (nodeX > containerNumX - 1) nodeX = containerNumX - 1;
###if (nodeY > containerNumY - 1) nodeY = containerNumY - 1;
###if (nodeZ > containerNumZ - 1) nodeZ = containerNumZ - 1;
// check proximity to existing nodes
float proximityRatio = 0.8;
bool acceptableNodeProximity = true;
for (int i = nodeX - 1; i <= nodeX + 1; i++)
if (acceptableNodeProximity)
for (int j = nodeY - 1; j <= nodeY + 1; j++)
if (acceptableNodeProximity)
for (int k = nodeZ - 1; k <= nodeZ + 1; k++)
if (acceptableNodeProximity)
if (i >= 0 && i < containers.size() && j >= 0 && j < containers[i].size() && k >= 0 && k < containers[i][j].size())
if (containers[i][j][k].size() > 0)
for (int n = 0; n < containers[i][j][k].size(); n++)
if (acceptableNodeProximity)
{
ofVec3f otherNode = nodes[containers[i][j][k][n]];
float dist = ofDist(newNode.x, newNode.y, newNode.z, otherNode.x, otherNode.y, otherNode.z);
if (dist < nodeRadius * proximityRatio) acceptableNodeProximity = false;
}
if (acceptableNodeProximity)
{
// add the new data to the existing
containers[nodeX][nodeY][nodeZ].push_back(nodes.size());
nodeContainer.push_back(vector <int> {nodeX, nodeY, nodeZ});
newLine.push_back(nodes.size());
lines.push_back(newLine);
nodes.push_back(newNode);
nodeParents.push_back(i);
}
newLine.clear();
}
}
}
// THICKNESS CALCULATION
void Venation3DClosed::calculateThickness()
{
// calculating end notes (without children)
hasChildren.resize(nodes.size(), false);
for (int i = 0; i < nodes.size(); i++)
if (nodeParents[i] > -1)
hasChildren[nodeParents[i]] = true;
// calculating each node's thickness
nodeThickness.resize(nodes.size(), 0);
for (int i = 0; i < nodes.size(); i++)
if (!hasChildren[i])
{
int index = i;
int counter = 1;
int counterMax = 1;
while (index > -1)
{
counterMax++;
index = nodeParents[index];
}
double denominator = log(counterMax);
index = i;
while (index > -1)
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!63
Appendices
Growing Venation Structures
{
counter++;
nodeThickness[index] += 1 + log(counter) / denominator;
nodeThickness[index] += 1;
index = nodeParents[index];
}
}
for (int i = 0; i < nodes.size(); i++)
nodeThickness[i] = 2 * pow(nodeThickness[i], 1.0 / 3.0);
}
// FINAL RNG FOR ANASTOMOSIS
void Venation3DClosed::finalRngStructure()
{
// getting initial structure
for (int i = 0; i < initialLinesSize; i++)
finalLines.push_back(lines[i]);
// getting max distances for each pair
for (int i = initialNodesSize; i < nodes.size(); i++)
for (int j = 0; j < i; j++)
{
bool relativeNeighborhood = true;
float ijDist = ofDist(nodes[i].x, nodes[i].y, nodes[i].z, nodes[j].x, nodes[j].y, nodes[j].z);
int iNodeX = nodeContainer[i][0];
int iNodeY = nodeContainer[i][1];
int iNodeZ = nodeContainer[i][2];
int jNodeX = nodeContainer[j][0];
int jNodeY = nodeContainer[j][1];
int jNodeZ = nodeContainer[j][2];
if (abs(iNodeX - jNodeX) < containerDist && abs(iNodeY - jNodeY) < containerDist && abs(iNodeZ - jNodeZ) < containerDist)
{
for (int k = 0; k < nodes.size(); k++)
if (i != k && j != k)
{
float ikDist;
float jkDist;
ikDist = ofDist(nodes[i].x, nodes[i].y, nodes[i].z, nodes[k].x, nodes[k].y, nodes[k].z);
jkDist = ofDist(nodes[j].x, nodes[j].y, nodes[j].z, nodes[k].x, nodes[k].y, nodes[k].z);
float maxDist = max(ikDist, jkDist);
// checking if there is a distance smaller than the pair distance
if (maxDist < ijDist)
{
relativeNeighborhood = false;
break;
}
}
}
else relativeNeighborhood = false;
if (relativeNeighborhood)
finalLines.push_back(vector <int> {i, j});
}
}
// SAVING TO DISK
void Venation3DClosed::saveFile(int num, float degreeOfOpenness, float ratioForSurface)
{
if (finalLines.size() > 0)
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!64
Appendices
Growing Venation Structures
{
ofxCsv csvRecorder;
csvRecorder.clear();
##ofxCsvRow row;
##string numString = to_string(num);
##string s = string(6 - numString.length(), '0') + numString;
##row.setInt(0, num);
##row.setFloat(1, degreeOfOpenness);
##row.setFloat(2, ratioForSurface);
##csvRecorder.addRow(row);
##row.clear();
for (int i = 0; i < finalLines.size(); i++)
{
// index
row.setInt(0, i);
// start point
int startIndex = finalLines[i][0];
float startX = nodes[startIndex].x;
float startY = nodes[startIndex].y;
float startZ = nodes[startIndex].z;
row.setFloat(1, startX);
row.setFloat(2, startY);
row.setFloat(3, startZ);
// end point
int endIndex = finalLines[i][1];
float endX = nodes[endIndex].x;
float endY = nodes[endIndex].y;
float endZ = nodes[endIndex].z;
row.setFloat(4, endX);
row.setFloat(5, endY);
row.setFloat(6, endZ);
// thicknesses
double startThickness = nodeThickness[startIndex];
double endThickness = nodeThickness[endIndex];
row.setFloat(7, startThickness);
row.setFloat(8, endThickness);
csvRecorder.addRow(row);
}
string fileName = "C:\\Users\\Saba Mirmotalebi\\Documents\\OpenFrameworks\\of_v0.10.0_vs2017_release\\apps\\myApps\
\VenationStructure\\bin\\data\\Files\\VenationMerged_";
fileName.append(s);
fileName.append(".csv");
string copy = "VenationMerged.csv";
csvRecorder.save(fileName); // to keep for records
csvRecorder.save(copy); // to interact with Grasshopper
}
}
APPENDIX D: GENETIC ALGORITHM PSEUDO-CODE"
// GENOTYPE CLASS
void Genotype::setup()
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!65
Appendices
Growing Venation Structures
{
#genes.resize(2);
#for (int i = 0; i < genes.size(); i++)
##genes[i] = ofRandom(0.1, 0.9);
}
void Genotype::mutate()
{
#for (int i = 0; i < genes.size(); i++)
##if (ofRandom(1.0) < 0.12) genes[i] = ofRandom(0.1, 0.9);
}
// PHENOTYPE CLASS
void Phenotype::setup(int _number, Genotype g)
{
#number = _number;
#Venation3D v;
#v.setup(500, 2, g.genes[0], g.genes[1], number);
#while (!v.done()) v.update();
}
void Phenotype::draw()
{
#string s = to_string(number);
#string numString = string(6 - s.length(), '0') + s;
#string fileName = "C:\\Users\\Saba Mirmotalebi\\Documents\\OpenFrameworks\\of_v0.10.0_vs2017_release\\apps\\myApps\
\VenationStructure\\bin\\data\\Files\\Analysis_" + numString + ".csv";
#ofxCsv csv;
#csv.load(fileName);
#ofSetColor(200);
#for (int i = 1; i < csv.size(); i++)
#{
##if (i == 1) ofDrawSphere(stof(csv[i][1]), stof(csv[i][2]), stof(csv[i][3]), stof(csv[i][7]));
##ofDrawSphere(stof(csv[i][4]), stof(csv[i][5]), stof(csv[i][6]), stof(csv[i][8]));
#}
}
float Phenotype::evaluate()
{
#float fitness = 0;
#string s = to_string(number);
#string numString = string(6 - s.length(), '0') + s;
#ofxCsv csv;
#string fileName = "C:\\Users\\Saba Mirmotalebi\\Documents\\OpenFrameworks\\of_v0.10.0_vs2017_release\\apps\\myApps\
\VenationStructure\\bin\\data\\Files\\Analysis_" + numString + ".csv";
#bool fileReadable = false;
#while (!fileReadable)
#{
##ifstream f(fileName.c_str());
##if (f.good())
##{
###fileReadable = true;
###f.close();
##}
##ofSleepMillis(100);
#}
#csv.load(fileName);
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!66
Appendices
Growing Venation Structures
#double disp = stod(csv[0][3]);
#double mass = stod(csv[0][4]);
#double dispFitness = sigmoid(4.5 - 1.5 * disp);
#double massFitness = sigmoid(15 - 0.02 * mass);
#float fitRatio = 0.6; // disp to mass
#fitness = dispFitness * fitRatio + massFitness * (1 - fitRatio);
#return fitness;
}
// INDIVIDUAL CLASS
void Individual::setup(int _number)
{
#number = _number;
#Genotype g;
#g.setup();
#m_gene = g;
#Phenotype ph;
#ph.setup(number, g);
#m_phen = ph;
#m_fitness = 0.0;
}
void Individual::setup(int _number, Genotype _g)
{
#number = _number;
#m_gene = _g;
#Phenotype ph;
#ph.setup(number, _g);
#m_phen = ph;
#m_fitness = 0.0;
}
void Individual::evaluate()
{
#m_fitness = m_phen.evaluate();
}
void Individual::draw()
{
#m_phen.draw();
}
// POPULATION CLASS
void Population::setup(int _population)
{
#generation = 0;
#population = _population;
#averageFitness = 0;
#pop.resize(population);
#for (int i = 0; i < population; i++)
#{
##Individual p;
##pop[i] = p;
##pop[i].setup(generation * population + i);
##pop[i].evaluate();
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!67
Appendices
Growing Venation Structures
#}
#sort(pop.begin(), pop.end(), compare);
#calculateAverageFitness();
}
void Population::evolve()
{
#generation++;
#vector <Individual> popNew;
#popNew.resize(population);
#for (int i = 0; i < population; i++)
##popNew[i] = breed(generation * population + i);
#for (int i = 0; i < population; i++)
##pop[i] = popNew[i];
#sort(pop.begin(), pop.end(), compare);
#calculateAverageFitness();
}
Individual Population::select()
{
#int which = (int)floor(((float)pop.size() - 1e-3) * pow(ofRandom(1.0), 2));
#return pop[which];
}
Individual Population::breed(int n)
{
#Individual a = select();
#Individual b = select();
#Individual c;
#Genotype cGenes;
#cGenes = crossover(a.m_gene, b.m_gene);
#cGenes.mutate();
#c.setup(n, cGenes);
#c.evaluate();
#return c;
}
Genotype Population::crossover(Genotype a, Genotype b)
{
#Genotype c;
#c.setup();
#for (int i = 0; i < c.genes.size(); i++)
#{
##if (ofRandom(1.0) < 0.5) c.genes[i] = a.genes[i];
##else c.genes[i] = b.genes[i];
#}
#return c;
}
void Population::calculateAverageFitness()
{
#float sum = 0;
#for (int i = 0; i < population; i++)
##sum += pop[i].m_fitness;
#averageFitness = sum / population;
}
// GLOBAL FUNCTIONS
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!68
Appendices
Growing Venation Structures
bool compare(Individual i, Individual j)
{
#return (i.m_fitness > j.m_fitness);
}
double sigmoid(double x)
{
#long double e = exp(-x);
#double mapped = 1.0 / (1 + e);
#return mapped;
}
APPENDIX E: GRASSHOPPER C# PSEUDO-CODE"
private void RunScript(string path, ref object data, ref object start, ref object end, ref object startThickness, ref object endThickness)
{
var lines = File.ReadAllLines(path);
var _start = new List<Point3d>();
var _end = new List<Point3d>();
var _startTh = new List<double>();
var _endTh = new List<double>();
string _data = lines[0];
for (int i = 1; i < lines.Length; i++)
{
var cells = lines[i].Split(new char[]{','}, StringSplitOptions.RemoveEmptyEntries);
_start.Add(new Point3d(double.Parse(cells[1]), double.Parse(cells[2]), double.Parse(cells[3])));
_end.Add(new Point3d(double.Parse(cells[4]), double.Parse(cells[5]), double.Parse(cells[6])));
_startTh.Add(double.Parse(cells[7]));
_endTh.Add(double.Parse(cells[8]));
}
data = _data;
start = _start;
end = _end;
startThickness = _startTh;
endThickness = _endTh;
}
private void RunScript(string data, double displacement, double mass)
{
var cells = data.Split(new char[]{','}, StringSplitOptions.RemoveEmptyEntries);
int num = int.Parse(cells[0]);
string path = @"C:\Users\Saba
Mirmotalebi\Documents\OpenFrameworks\of_v0.10.0_vs2017_release\apps\myApps\VenationStructure\bin\data";
string file = "Analysis_" + num.ToString("D6") + ".csv";
Print(num.ToString("D6"));
string analysis = data + ',' + displacement + ',' + mass;
Print(analysis);
File.WriteAllText(path + @"\Files\" + file, analysis);
}
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!69
Appendices
Growing Venation Structures
APPENDIX F: GRASSHOPPER ANALYSIS"
UCL | MSc AC 2017/18 | Saba Sadat Mirmotalebi Sohi
!70
ResearchGate has not been able to resolve any citations for this publication.
Conference Paper
Full-text available
This research paper explores the use of 3D-printing technologies in prototyping of Topology Optimization (TO) driven design. The paper describes the integration of TO into an early design work-flow and highlights the difficulties thereof. Due to the high computation times of TO, we outline the use of statistical learning to approximate TO material density results. Specifically, we highlight the use of such techniques for TO of thin-shell, non-volumetric geometries and the incorporation of specific assumptions related to such geometries to improve the functional approximation using statistical methods. We describe the various stages of the design pipeline that benefit from interactive TO.
Article
Full-text available
Over the years many techniques have been developed for simulating and modelling trees, ferns, crystals and natural structures. Indeed, many complex and realistic images have been formed. Often, these rely on rule based systems to create the structure, they start with a simple form and progressively refine it into a more complex form by applying rules. We use the notion of Sticky Pixels to form textures. The pixels (or objects) move around the space, when they touch another object they stick together to form a larger cluster. The objects aggregate and stop at the place and position where they first touched. Such an aggregation generates neighbourhoods of pixels that form natural looking shapes. The pixels may randomly walk around (such as using Brownian motion), or be guided along pre-defined routes (often described as ballistic), to obtain different structures. We use a ballistic aggregation technique, where the particles are randomly dropped onto a canvas, migrate and stick onto the closest position of the nearest cluster. We present Sticky Pixels, explain different parameters and describe our algorithm.
Conference Paper
Full-text available
We extend the open leaf venation model by Runions et al. (RFL 05) to three dimensions and show that it gener- ates surprisingly realistic tree structures. Model parameters correspond to visually relevant tree characteristics identified in landscaping, offering convenient control of tree shape and structure.
Book
In this book Gary William Flake develops in depth the simple idea that recurrent rules can produce rich and complicated behaviors. Distinguishing "agents" (e.g., molecules, cells, animals, and species) from their interactions (e.g., chemical reactions, immune system responses, sexual reproduction, and evolution), Flake argues that it is the computational properties of interactions that account for much of what we think of as "beautiful" and "interesting." From this basic thesis, Flake explores what he considers to be today's four most interesting computational topics: fractals, chaos, complex systems, and adaptation. Each of the book's parts can be read independently, enabling even the casual reader to understand and work with the basic equations and programs. Yet the parts are bound together by the theme of the computer as a laboratory and a metaphor for understanding the universe. The inspired reader will experiment further with the ideas presented to create fractal landscapes, chaotic systems, artificial life forms, genetic algorithms, and artificial neural networks.
Book
There are many books on finite element methods but few give more than a brief description of their application to structural vibration analysis. This book presents an introduction to the mathematical basis of finite element analysis as applied to vibrating systems. Finite element analysis is a technique that is very important in modeling the response of structures to dynamic loads. Although this book assumes no previous knowledge of finite element methods, those who do have knowledge will still find the book to be useful. It can be utilized by aeronautical, civil, mechanical, and structural engineers as well as naval architects. This second edition includes information on the many developments that have taken place over the last twenty years. Existing chapters have been expanded where necessary, and three new chapters have been included that discuss the vibration of shells and multi-layered elements and provide an introduction to the hierarchical finite element method.
Article
The relative neighbourhood graph (RNG) of a set of n points on the plane is defined. The ability of the RNG to extract a perceptually meaningful structure from the set of points is briefly discussed and compared to that of two other graph structures: the minimal spanning tree (MST) and the Delaunay (Voronoi) triangulation (DT). It is shown that the RNG is a superset of the MST and a subset of the DT. Two algorithms for obtaining the RNG of n points on the plane are presented. One algorithm runs in 0(n2) time and the other runs in 0(n3) time but works also for the d-dimensional case. Finally, several open problems concerning the RNG in several areas such as geometric complexity, computational perception, and geometric probability, are outlined.
Book
1 Graphical modeling using L-systems.- 1.1 Rewriting systems.- 1.2 DOL-systems.- 1.3 Turtle interpretation of strings.- 1.4 Synthesis of DOL-systems.- 1.4.1 Edge rewriting.- 1.4.2 Node rewriting.- 1.4.3 Relationship between edge and node rewriting.- 1.5 Modeling in three dimensions.- 1.6 Branching structures.- 1.6.1 Axial trees.- 1.6.2 Tree OL-systems.- 1.6.3 Bracketed OL-systems.- 1.7 Stochastic L-systems.- 1.8 Context-sensitive L-systems.- 1.9 Growth functions.- 1.10 Parametric L-systems.- 1.10.1 Parametric OL-systems.- 1.10.2 Parametric 2L-systems.- 1.10.3 Turtle interpretation of parametric words.- 2 Modeling of trees.- 3 Developmental models of herbaceous plants.- 3.1 Levels of model specification.- 3.1.1 Partial L-systems.- 3.1.2 Control mechanisms in plants.- 3.1.3 Complete models.- 3.2 Branching patterns.- 3.3 Models of inflorescences.- 3.3.1 Monopodial inflorescences.- 3.3.2 Sympodial inflorescences.- 3.3.3 Polypodial inflorescences.- 3.3.4 Modified racemes.- 4 Phyllotaxis.- 4.1 The planar model.- 4.2 The cylindrical model.- 5 Models of plant organs.- 5.1 Predefined surfaces.- 5.2 Developmental surface models.- 5.3 Models of compound leaves.- 6 Animation of plant development.- 6.1 Timed DOL-systems.- 6.2 Selection of growth functions.- 6.2.1 Development of nonbranching filaments.- 6.2.2 Development of branching structures.- 7 Modeling of cellular layers.- 7.1 Map L-systems.- 7.2 Graphical interpretation of maps.- 7.3 Microsorium linguaeforme.- 7.4 Dryopteris thelypteris.- 7.5 Modeling spherical cell layers.- 7.6 Modeling 3D cellular structures.- 8 Fractal properties of plants.- 8.1 Symmetry and self-similarity.- 8.2 Plant models and iterated function systems.- Epilogue.- Appendix A Software environment for plant modeling.- A.1 A virtual laboratory in botany.- A.2 List of laboratory programs.- Appendix B About the figures.- Turtle interpretation of symbols.
Thesis
Recently, ray tracing on consumer level graphics hardware has been introduced. So far, most published studies on this topic use the uniform grid spatial subdivision structure for reducing the number of ray/triangle intersection tests. For many types of scenes, a hierarchical acceleration structure is more appropriate. We compare GPU based traversal of kd-trees and uniform grids with a novel bounding volume hierarchy traversal scheme. The three implementations are compared in terms of performance and usefulness on the GPU. We conclude that on the GPU, the bounding volume hierarchy traversal technique is up to 9 times faster than our implementations of uniform grid and kd-tree. Additionally, this technique proves the simplest to implement and the most memory efficient. Danish summary Raytracing er en velkendt teknik til frembringelse af foto-realistisk 3D grafik p˚a computere. Whitted tildeles almindeligvis æren for den klassiske