July 2017

A simple Rhino Python script that generates fractal curves. Example is the test with Gosper-Peano curve. However the script is not supporting segment directions, that is why the result is not the intended curve. Curve directions could be implemented in the future. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # Drawing Simple Fractal Curves # 31.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs import copy initials = rs.GetObject("Select Initial […]

Studied earlier in Grasshopper here, the sunflower spiral or Phyllotaxis, or Fermat’s spiral could be drawn as an exercise of looping in Rhino Python. 1 2 3 4 5 6 7 8 9 10 # Drawing the Fermat’s Spiral with Circles # 30.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs import math s = 137.508 for n in range(0,500): t = math.sqrt(n) g = n * s z = rs.Polar([0,0,0],g,t) rs.AddCircle(z,0.3)# Drawing the Fermat’s Spiral with Circles # 30.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs import math […]

Video showing the method to draw variable stellations of an icosahedron. For more information, visit here. You can search for “icosahedron” in designcoding to see the construction of it.

1 2 3 4 5 6 7 8 9 10 11 12 13 # Drawing the Convex Hull of Given Points # 28.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs points = rs.GetPointCoordinates("Select points") a = min(points) start = a while a: o = a a = points[0] for b in points: if (a[0]-o[0])*(b[1]-o[1])-(a[1]-o[1])*(b[0]-o[0]) < 0: a = b rs.AddLine(o,a) if a == start: break# Drawing the Convex Hull of Given Points # 28.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs points = rs.GetPointCoordinates("Select points") a = min(points) […]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Delaunay Triangulation of Given Points # 27.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs from itertools import combinations as cb points = rs.GetObjects("Select points for Delaunay Triangulation", 1) set = list(cb(points,3)) for tuple in set: c1 = rs.PointCoordinates(tuple[0]) c2 = rs.PointCoordinates(tuple[1]) c3 = rs.PointCoordinates(tuple[2]) if (c1[0]-c2[0])*(c3[1]-c2[1])-(c1[1]-c2[1])*(c3[0]-c2[0]) != 0: circle = rs.AddCircle3Pt(tuple[0],tuple[1],tuple[2]) delaunay = 0 for point in points: if rs.PointInPlanarClosedCurve(point,circle) == 1: delaunay = 1 continue if delaunay == […]

Exercising the “folding” process of a nine-faced solid. Start from its net, analyze the matching edges. Then, use sphere intersections to calculate the rotation angles. Visit here for more information about this solid: http://aperiodical.com/2013/10/an-enneahedron-for-herschel/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 # Draw centered hexagonal grid # 25.07.2017 www.designcoding.net – Tugrul Yazar import rhinoscriptsyntax as rs import math hexGridCenter = rs.GetPoint("Specify center point") hexGridExtend = rs.GetInteger("Enter the number of radial levels", 3, 2) hexGridClSize = rs.GetReal("Edge size of hexagons", 1.0) hexGridCAngle = rs.GetReal("Rotation angle of hexagons", 0.0) edges = 6 rs.AddPoint(hexGridCenter) hexGrid = [] pythagoras = 2 * math.sqrt((hexGridClSize * hexGridClSize) – […]