The focus of this assignment was to explore the constraints and rules relating to the basic operating of Python in conjunction to Rhino. The outcome was a fixed product drawing mostly on the in-program commands from Rhino evoked by name in Python. In this exercise these skills were used to generate a two dimensional image of a character from a cartoon.
#Clearing leftover objects
rs.DeleteObjects (rs.AllObjects())
#Drawing body and screen and text box
rs.AddRectangle( [0,0,0], 15, 25 )
rs.AddRectangle( [1,14,0], 13, 10 )
rs.AddRectangle( [16,16,0], 15, 5)
#Fillet shapes for body, screen, and text box
rs.Command("SelAll")
rs.Command("FilletCorners 1")
rs.Command("DeselectAll")
#Drawing Eyes
rs.AddCircle ( [4,20,0], .25)
rs.AddCircle ( [11,20,0], .25)
#Drawing mouth
rs.AddArc3Pt ( [5,18,0], [10,18,0], [7.5,15.5,0] )
rs.AddLine ( [5,18,0], [10,18,0] )
#Drawing arc for tongue
rs.AddArc3Pt ( [6,16,0], [9,16,0], [7.5,16.5,0] )
#Drawing plus outline (1/4 of total shape)
rs.AddPolyline ( ([4,7,0],[5,7,0],[5,8,0],[4,8,0]) )
#Selecting and arraying the plus pieces
rs.SelectObjects( rs.WindowPick ( [6,6,0],[3,9,0], view="Top") )
rs.Command("ArrayPolar 3.5,7.5 4 360 Enter")
rs.UnselectAllObjects ()
#Adding buttons, circular and triangular
rs.AddCircle([12,12,0,], .5)
rs.AddCircle([13.5,6,0], .5)
rs.AddCircle([12,3,0], 1.5)
rs.AddPolyline(([11,6,0], [8,6,0], [9.5,8.5,0], [11,6,0]))
#Adding oval buttons on bottom
rs.Command("Rectangle Rounded 1,2,0 3.5,3,0 0.5")
rs.Command("Rectangle Rounded 4,2,0 6.5,3,0 0.5")
#Oval button at top
rs.Command("Rectangle Rounded 3,12,0 9,13,0 0.5")
#Hi Finn and Jake
rs.AddText ("Hi Finn and Jake!", [18,18,0])
rs.AddPolyline (([18,16,0], [18,15,0], [20,16,0]))
#Drawing Feet
rs.Command("Rectangle Rounded 3,-4,0 5,-3,0 0.5")
rs.AddLine([5,-3.5,0], [5,0,0])
rs.AddLine([4,-3,0], [4,0,0])
rs.Command("Rectangle Rounded 10,-4,0 12,-3,0 0.5")
rs.AddLine([10,-3.5,0], [10,0,0])
rs.AddLine([11,-3,0], [11,0,0])
#Adding arms
rs.AddArc3Pt([0,11,0],[-4,15,0],[-3.47,13,0])
rs.AddArc3Pt([0,10,0],[-5,15,0],[-3,11,0])
rs.AddArc([-4.5,15,0],.5,180)
rs.AddArc([15,6,0],4,90)
rs.AddArc([15,6,0],5,90)
rs.AddArc([19.5,6,0],.5,-180)
#View Work
rs.ZoomExtents("Top")