Blog

July 30, 2020

Customized Gene Pool

Anyone has experienced working with well known Galapagos as the Genetic Algorithm component in Grasshopper, might know it is not that much customizable for input genes set. Since every gene we need to define by gene-pool has to be set by just one specific type of integer or float with a certain decimal number, we used Python coding to have everything open to edit in this part of defining the optimization algorithm. This might take any mind that why we didn’t use number sliders instead of gene-pool? This is an appropriate question but if you want to keep your sliders fixed where they are affecting other parts of your algorithm and at the same time you need to run optimization with the range of numbers each slider has covered, you need something similar to what have done here. Despite the fact, this is just defined as a certain approach to solving the problem has mentioned, it also used here according to what we required for structural parametric study engaging with Karamba3D.

We started to equip the algorithm utilizing this idea originated from writing a class with determined definitions toward taking column points of the free form structure. The form had been panelized by Iranian Girih geometry. The whole procedure which is under development yet dedicates to one of our researches to get to know how strength through these geometrical elements’ arrangements had been designed conscientiously. I have to thank Amir Hossein Sattari for his amazing endeavors which caused developing progressions about this research.

One of the most interesting challenges took me myself through engineering designs, is free from structures. Lots of progressions have happened in recent years from world leaders of such beautiful structures. One of the popular impressive teams is Block Research Group well-known as BRG from ETH Zurich. It is being developed under supervision of Professor Philippe Block whose works have been motivating me to research in this field. There are lots of innovative ideas we can have from designing, analyzing, and engineering to have structures optimized to fabrication processes, where this field could be a pitch to get involved with. If any parameter changes, the whole system has to be updated accordingly hence, free form structures are mainly a stimulating area for those who are an enthusiast with technology in different aspects as declared above.

I started to work on this amazing area whereas a professional experience I had to improve a free-form triangular tessellation by shape optimization. The project finished after 8 months and assembled in just 3 weeks. This experience was a launch-pad for me to start working on an add-on for detail designing free form single-layer structures. After the very first version, we name it Caddisfly. It works on optimized linear models to have 3d details from elements and nodes by just 5 clicks. It’s still under development but we use it exclusively in professional projects. One of the biggest parts of such projects is to have elements and shapes reading force flows and act adapted to load cases. This could be set by the geometry selected for every element in 3d format where we can use the term: “strength through geometry” (By prof. Block). This is the main idea I am working on and in this project, we will review the process by working on an image processing scenario to generate models from images of Iranian Girih Geometries. This is just an initial idea about traditional Iranian masters thought on geometry they had frequently used back then and it needs to be checked more precisely which we are heading to.

The code below is related to what has been defined for Gen Pool. It’s simply works but limited to the project presented above. Any customization needed we can adapt this code procedure to what any specific research possibly has for parametric connections from model to analyzer. In any case you might want to know more about this code, feel free to comment underneath.

import random as rnd
import Rhino.Geometry as rg
import ghpythonlib.components as ghc

print (len(PointList))

#----------------------Class for Functional Programming--------------#

class LinPoint:
    
    def __init__(self, Points_List):
        self.Point_List = Points_List
        
        
    def Linerizer(self):
        
        L = []
        VLs = []
        for i in range(len(self.Point_List)):
            Vec = rg.Vector3d(0, 0, -self.Point_List[i].Z)
            Vertical_Lines = rg.Line(self.Point_List[i], Vec)
            Vertical_Curves = rg.Line.ToNurbsCurve(Vertical_Lines)
            VLs.append(Vertical_Curves)
            L.append(Vertical_Lines)
            i += 1
        return VLs
            
    def Projection(self):
        P =[]
        for i in range(len(self.Point_List)):
            Proj_ = rg.Intersect.Intersection.CurvePlane(self.Linerizer()[i-1],
            rg.Plane.WorldXY, 0.00)[0].PointA
            P.append(Proj_)
        return P

#---------------------Definition Implementation--------------#

VC = LinPoint(PointList)
Vertical_Curve = VC.Linerizer()

PJ = LinPoint(PointList)
Projects = PJ.Projection()

#----------------------Decision Making for Suppor Selection--------------#

ClosestPoints_dis = ghc.PullPoint(Projects, InputCrvs)
    
Distances = ClosestPoints_dis[1]
Closest_Pts = ClosestPoints_dis[0]

Decisions = []

for i in range(len(Distances)):
    
    if Distances[i] < float(ColumnDis):
        Decisions.insert(i, True)
    else:
        Decisions.insert(i, False)

SuppRegion = ghc.CullPattern(Projects, Decisions)
SuppUpper = ghc.CullPattern(PointList, ghc.ShiftList(Decisions, 1, True))




#----------------------Projecting Support as Randomization Controling--------------#


rnd.seed(RandomSeed)
Supp_Points = rnd.sample(SuppRegion, nSupp)
Supp_P = rnd.sample(SuppUpper, nSupp)
Architecture, Coding, Computational Design, Data Science & Visualization, Favorites & More, Lectures and Presentations, OpenSource, Research & Development , , , ,
4.5 2 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments