Functional X (Paradigms_in_Design + Coding_in_Python)
DigitalFutures2021 Workshop №119: Learning Python and how to code for Architects based upon Functional Paradigms in Iranian Architecture
InclusiveFUTURES2021
DigitalFUTURES summer theme in 2021 was labeled as InclusiveFUTURES, where every peripatetic move is considered an accessible, equitable adventure via different events from the brightest minds in the world. Professors, researchers, professionals gathered to support such a fantastic itinerary through knowledge dissemination fast-forwardly towards a better future in design, engineering, and construction. Over 100 workshops also accrued the whole event with diverse subjects contrived from many terms and keywords elicited of cutting-edge technologies represented in over ten languages. The idea behind the scene is to have a general ambiance for everyone using technology in AEC, and the primary priority of this convivial space is to burgeon recent discoveries being explored precisely and conducive. In correspondence to this picturesque perspective, many people got involved as young architects leading the way DigitalFUTURES advocates for education and human right by appealing altruism of everyone for their time and efforts as a comprehensive amalgamation of perpetual growth.
Functional X, Mainstream and Objectives
The main idea behind the Functional X was to contribute participants getting started to code with Python; however, the segments had been contrived by a research-based project dedicated to using python packages from Anaconda endowed by GhPythonRemote within Grasshopper3D to make the training more delicate and precise to be exceedingly reliable as a journey. The mainstream of the research was to manipulate data from Iranian Traditional Girih Geometry inverted-plan pictures on free-form structures and appraising structural functions by Finite Element Analysis (FEA). Participants dealt with learning how to jump-start with Python functionally, while the instructors were arranged to take on the FEA part for the final models. The expected consequence of this research was to generate reliable data for further steps of comprehensive explorations on Girih Geometries’ functional attributes. The workshop breakdown was defined based on covering these steps:
Intro + Research presentation > Starting on Python > Warmup Section (Dive-into Py) > Anaconda & Python Packages > Free-Form Generative design component development > FEA exploration > Final results visualizations.
Accordingly, participants were asked to get along with the research-related considerations into traditional structural geometries for the first steps. While learning about Python, they experienced warming up for the workshop’s core by training data structure. The second they were into how to use Python within the core project; the most excitable part got started by using Anaconda to implement data-driven free-form design emerged from the geometries. The final part was also set by visualizing the outputs after evaluating the functions of the free-forms. The steps were derived from specific keywords to facile the gleaning workshop materials in Python Programming, Strength through Geometry, Functional Paradigm, and Free-Form structures. Any endeavors for sharing knowledge could not be readily imbibed without due implication of Grasshopepr3D add-ones participants and instructors decided to choose like Karamba3D, WeaverBird, RhinoVault, and, Kangaroo during the workshop.
Correspondingly, while the generating model part was being conceived, AmirHossein Sattari, Mahdi AghaMohammadi, and Ahmed Sattar joined the workshop in exclusive chapters to help participants get along with FEA check how their design would work based on different Load-Cases.
It was expected that participants would learn how to deal with python programming fundamentally towards getting pros. They also had their way into practical empiricism to be prepared for research-based perspectives to solve complex problems by experiencing a dedicated sight represented as the assets of the workshop sharing knowledge between participants and instructors. The 6 sessions had also been arranged by the bullets below:
· Getting Started: Research Presentation: Defining Path: Python Basics
· Warming Up: Starting to Code outbursts!: Getting along with Python
· Diving into RhinoCommon and starting on how to deal with its elements based on the research principles
· Going through Anaconda and data manipulation starts: First 3dodel generating starts!
· FEA lecture and information-based modeling visualization
· Final presentation by participants!
Learning via R&D style
The more practical the experience everybody faces is, the more commensurate will be set from idea generating towards accurate asset delivery in every learning process. Therefore, we decided to add more ingredients to the main idea to have a multidisciplinary thinking space. Iranian Architecture is a great deal to explore more punctiliously while there are many aesthetic writing about it; unfortunately, the engineering part of creating these masterpieces, which is an accumulated outcome of 7000 years of experience, has not been explored consummately. Thus, having reciprocal structural elements from Girih geometries to be processed from images and conveyed to generative python-based code as 3D free-form structures defined our brainstorming of the primary research which we put up so participants can learn how to code in python right in an inundated atmosphere of a challenge for recalling the beauty beside functions of traditional Iranian architecture. The code and the related phases are dedicated to the final project we had.
###-----------Imporintg Module + Image Data Reading -------------###import os
import ghpythonremote
from ghpythonlib.treehelpers import list_to_tree
import rhinoscriptsyntax as rs
import scriptcontext as sc
from System import Arraynp = sc.sticky['numpy']
mpl = sc.sticky['matplotlib']
plt = mpl.pyplot
pil = sc.sticky['PIL']
cv2 = sc.sticky['cv2']a = str(np.random.random((5,2)))#---------------Image Processing-------------#Data = []
img = np.asarray(pil.Image.open(path))print (img[0,0,1])for i in range(25):
for j in range(25):
Data.append(str(img[i, j, 0]))
#print DataData_Code = Data[0]###----Data Manipulation + Free-Form derivative data tracking --####---------------SunDivision-------------#Domain = rg.Interval(0, 10)U_ = []
V_ =[]Subd_Srfs = []C1 = 10/U
C2 = 10/Vfor i in range(0, U, 1):
U_int = rg.Interval(i*(10/U), C1)
C1 += 10/U
U_.append(U_int)for j in range(0, V, 1):
V_int = rg.Interval(j*(10/V), C2)
C2 += 10/V
V_.append(V_int)for i in range(len(U_)):
for j in range(len(V_)):
Subd_Srfs.append(rg.Surface.Trim(Srf, U_[i], V_[j]))#---------------Colouring-------------#Colours = []
for i in Data:
Colour_ID = rs.CreateColor(i, i, i)
Colours.append(Colour_ID)#---------------Point@-------------#Domain = rg.Interval(0, 1)for i in Subd_Srfs:
rg.Surface.SetDomain(i, 0, Domain)
rg.Surface.SetDomain(i, 1, Domain)Center_pt = []for i in range(len(Subd_Srfs)):
Center_pt.append(rg.Surface.PointAt(Subd_Srfs[i], 0.5, 0.5))#---------------Remaping-------------#Data_Range = max(Data) - min(Data)
#print Data_Range
New_Range = Domain_End - Domain_StartNew_Values = []
for i in Data:
Val = ((i - min(Data))/Data_Range) + Domain_Start
New_Values.append(Val)#---------------SubSelection-------------#IEn = [i for i, item in enumerate(New_Values) if item < Selection_Telorence]Selected_Pts = []for i in IEn:
Selected_Pts.append(Center_pt[i])###------------ Mesh Generating + Optimizing -----------------####pl = rg.Plane.FitPlaneToPoints(pt)
meshXL = rg.Mesh.CreateFromTessellation(pt, None, rg.Plane.WorldXY, False)topo = meshXL.TopologyEdges
MeshEdge = []
for i in range(topo.Count):
MeshEdge.append(topo.EdgeLine(i))FinalEdges = []for item in MeshEdge:
if item.Length < Telorence:
FinalEdges.append(item)arr_lines = Array[rg.Curve](Lines)
print arr_lines
mesh = rg.Mesh.CreateFromLines(arr_lines, Face_Valence, Meshing_Tolerence)
Conclusion
The whole idea titled Functional Paradigm is a comprehensive concept to explore what traditional masters have left us with while the outcome can be adapted to the derivative processes from Design, Engineering, and Construction. However, the workshop aimed at just one structural function; there are many variables to consider where integrated design is being contemplated to be reviewed. Different factors have a series of parameters inside, and as architecture is about to deliver a better response to catch the commensurate between these factors, this workshop can be determined by the first step of such understanding. The future development of this perspective endowed with traditional buildings could contrive the implication of high-tech algorithms. In that case, clustering can be assessed to eliminate the non-correlated options within generating meshes. Syncing attributes by shapes out of images by leading the labels based on color marks to categorize the attributes dedicated to specific shapes we want to take out from a complex, high-quality image can also be appraised by categorization algorithms. Thus, in conclusion, it is essential to know, there are many other ways instead of image process to grasp the exploration of traditional master’s brilliant ideas from buildings, specifically with photogrammetry or using speculator algorithms working with cloud points and also 3d scanning the models in a large amount of information. The main issue here is to define reliable data collecting to up and run similar researches.
Thanks to DigitalFUTURES, we had an amazing start on developing the whole idea by using Python and Grasshopper3D. Besides appreciable endeavors anyone listed above made for this amazing adventure we had together, you can find each one of us here on Instagram:
Zubin Khabazi, Mahdi Fard, Mahdi AghaMohammadi, AmirHossein Sattari, Ahmed Sattar
Sara Pezeshk, Ali Ghadamyari, Masoud Ghasemi, Nillofar Imani, Mehrnoush Nabizadeh, Amir Bahraminia, Parastoo Samadi, Mahnaz Bahremandi, Diba Baghernezhad, MohammadHossein Karimian