1/27 – 1/29 / lines of code -camilo tirado

import rhinoscriptsyntax as rs
# Author: Camilo Tirado
# Date: Jan 29st, 2016
# Purpose: arrays of honeycombs for lasercut
# Input Parameters: None
# Output Parameters: None

def addWorkArea():
    """
    purpose: to define the area of the material
    input parameters: none
    output parameteres: none
    """
    pass
    plane = rs.WorldXYPlane()
    x = rs.GetInteger("Width", None, 30, None)
    y = rs.GetInteger("Height", None, 30, None)
    rs.AddRectangle(plane, x, y)
    
def addHexagon():
    """
    purpose: to create the basic geometry.
    input parameters: none
    output parameters: none
    """
    rs.AddLine([6,4,0],[6,6,0])
    times = 5
    for j in range(times):
        Line = rs.GetObject("Select Line to rotate")
        if Line:
            point = rs.GetPoint("Center point of rotation")
            if point: rs.RotateObject(Line, point, -60, None, copy=True)
    ends = rs.GetPoints(draw_lines = True, message1 = "pick ends", max_points = 6)
    points = rs.AddPoints(ends)
    rs.AddCurve(rs.GetPoints(),1)
    lines = rs.GetObjects("Select Lines to delete")
    rs.DeleteObjects(lines)

def addHoneyComb():
    """
    purpose:add inner layer of honeycomb and hatch.
    input parameters: none
    output parameters: none
    """
    Hexagon = rs.GetObject("Select Hexagon",4)
    rs.OffsetCurve(Hexagon, [6,5,0], 0.30,)
    honeycombs = rs.GetObjects("Select honeycombs",4)
    if honeycombs:
        if rs.IsHatchPattern("Grid60"):
            rs.AddHatches(honeycombs,"Grid60", 1)
        else:
                rs.AddHatches(honeycombs, rs.CurrentHatchPattern())
    rs.AddGroup("HoneyComb")
    HoneyComb = rs.GetObjects("Pick Honeycomb and Hatch")
    rs.AddObjectsToGroup(HoneyComb, HoneyComb)

def addLayout():
    pass
def addArray1():
   pass
def addArray2():
    pass

def LaserCut1():
    pass
    addWorkArea()
    addHexagon()
    addHoneyComb()
    addLayout()
    addArray1()
    addArray2()

LaserCut1()

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