Project 1: Ornamental_Pattern

by AnzuK1 in Craft > Digital Graphics

123 Views, 0 Favorites, 0 Comments

Project 1: Ornamental_Pattern

Cover.png

In this project, create the ornamental pattern by Rhino with Grasshopper. We can automatically generate the pattern with Python programming. Therefore, I try to generate a fractal shape with Grasshopper. When I searched the fractal shape. I found the Processing code of the Sierpinski gasket. According to the Processing code of the drawing Sierpinski gasket, I coded with Python.

Creating the Patten in Python

Picture1.png

In the Python code to generate the fractal shape, I wrote a code like the following.

p1 and p2 are two points in the Rhino coordinate. According to two points, the height and width of the shape are decided. The number of the point is decided by the MAX_LEVEL. VERT_NUM decides the edge of the shape. This code generates the four fractal shapes, the distance of the four fractal shapes is decided by delta.

pt = []
dx = abs(p2.X-p1.X)/(rx-1) dy = abs(p2.Y-p1.Y)/(rx-1) width = abs(p2.X-p1.X) height = abs(p2.Y-p1.Y) x = width/2 y = height/2 i = 0 while i < MAX_LEVEL: px = r * math.cos(2*math.pi / VERT_NUM * (i+0.5)) + x; py = r * math.sin(2*math.pi / VERT_NUM * (i+0.5)) + y; pt.append(rs.CreatePoint(px, py, 0.0)) pt.append(rs.CreatePoint(px + delta, py, 0.0)) pt.append(rs.CreatePoint(px + delta, py + delta, 0.0)) pt.append(rs.CreatePoint(px, py + delta, 0.0)) x = px y = py r = r * k
i = i + 1 o = pt

Output the Pattern and Bond It

Picture5.png
Picture2.png
Picture3.png

According to the parameter that is shown in the figure in Step 1. The output like this figure is obtained. This is a just collection of the curve and we can not use it for 3D print. Therefore we use one of the functions in the Grasshopper and Bond these curve collections.

The collection of the curve is created by this code. (This code is used Jennifer's example)

""" create a list of lines """
ln = []
d2 = dist*dist
for j in range(0,len(pt)):
for i in range(j+1,len(pt)):
if(dist2(pt[i],pt[j])
b = ln

These curve collections are bond with OffCurv and functions that are seen in the figure in the Grasshopper.

Export STL File and Slice in the Software for 3D Print

Picture4.png
Picture6.png
Picture7.png
Picture8.png

The Exported STL file is like the figures above. According to the software for 3D printing, if we 3D print this material, it takes 4 minutes.

Enjoy Fractal Shape With Changing Various Parameters

Screen Shot 2021-04-05 at 6.03.01 PM.png
Picture9.png

We can change the parameter to change the shape of the pattern. With several settings of the parameter, I also generated other ornament patterns like these figures.

STL Files...

10.png
11_5.png
12.png
13.png