snowflake 2

snowflake2

 

 

 

# @fabiolr mathArt exercise
# koch lines using f library
import rhinoscriptsyntax as rs
import modules.f as f
import math as m # for square root
reload(f)

#globals
scale = .8
trisides = range(10,125,30)
scale = 2
minLenght = .7
for side in trisides:

# Make a Triangle and kochify each side

height = m.sqrt(3) / 2 * side # basic trigonometry
p1 = -side/2, -height/3, 0
p2 = side/2, -height/3, 0
p3 = 0, height/3*2, 0
p4 = p1

triPoints = [p1,p2,p3,p4]
sides = []

for i in range(3):
linePoints = (triPoints[i],triPoints[i+1])
sides.append(f.Line(linePoints))
sides[i].draw()
sides[i].kochify(minLenght,scale)

Leave a comment