Fachini_Makedragonfly

wing pattern

 

import rhinoscriptsyntax as rs

#Author: Stefani Fachini
#Date: Feb22/2106
#Purpose: practice
#Imput parameters: makewings
#Output parameters: yes

def makeWing():
p0 = (3.18, 9.3, 0)
p1 = (10.34, 7.82, 0)
p2 = (18.26, 7.36, 0)
p3 = (19.44, 3.61, 0)
p4 = (12.79, 1.66, 0)
p5 = (5.97, 0.56, 0)
p6 = (2.24, 5.27, 0)

parc1 = (20.29, 5.98, 0)
parc2 = (16.68, 2.37, 0)
parc3 = (9.04, 0.59, 0)
parc4 = (3.18, 1.89, 0)

points = (p0, p1, p2)
points2 = (p0, p6)

crv1 = rs.AddCurve(points, degree=3)
crv2 = rs.AddArc3Pt(p2, p3, parc1)
crv3 = rs.AddArc3Pt(p3, p4, parc2)
crv4 = rs.AddArc3Pt(p4, p5, parc3)
crv5 = rs.AddArc3Pt(p5, p6, parc4)
crv6 = rs.AddCurve(points2, degree=3)

curves = (crv1, crv2, crv3, crv4, crv5, crv6)
outline = rs.JoinCurves(curves, True)

def makeWingPattern():
attractor = rs.GetPoint()
print attractor
xlist = rs.frange(1,30, 0.5)
ylist = rs.frange(1,30, 0.5)
for x in xlist:
for y in ylist:
#calculate distance
pt1 = attractor
pt2 = x,y,0
distance = rs.Distance(pt1, pt2)
#make a circle
center = x,y,0
rad = distance/30
rs.AddCircle(center,rad)

def makeTwoWings():
obj = rs.GetObjects()
start1 = 0.61, 0.12, 0
end1 = 0.61, 0.08, 0
mirror = rs.MirrorObject(obj,start1,end1, copy=True)


def makeWings2():
obj = rs.GetObjects()
start2 = 0.58, 0.13, 0
end2 = 0.67, 0.13, 0
mirror2 = rs.MirrorObjects(obj, start2, end2, copy = True)

def main():
#makeWing()
#makeWingPattern()
#makeTwoWings()
makeWings2()

main()


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s