1/25 – 10 lines – camilo tirado

import rhinoscriptsyntax as rs
# Author: Camilo Tirado
# Date: Jan, 25, 2016
# Purpose: skeleton code for beehive
# Input Parameters: None
# Output Parameters: None
def addHexagon ( ):
    """ purposes: Create basic geometric shape,
    *update 1/25: picked new points for a 'real' hexagon shape
    Input Parameters: None
    Output Paramters: None
    """
    p0 = 0,0,0
    p1 = 3.88201841817204,-5.50648415753585E-11,0
    p2 = 5.82275900341455,3.31625892362967,0
    p3 = 3.88201841799135,6.72385313643489,0
    p4 = -9.5378260844825E-11,6.72385313632113,0
    p5 = -1.93718078733737,3.53429057802418,0
    points = p0, p1, p2, p3, p4, p5, p0
    rs.AddCurve(points, 1)

def addHoneyComb():

    """purposes: add outter edge to the hexagon and repeat the geometry
    input parameters: object id, direction, distance
    output parameters: none
    """
    outteredge = rs.GetObject("select hexagon",4)
    if outteredge:
        rs.OffsetCurve(outteredge, [2,3,0], 0.5)
        HoneyComb = rs.GetObjects("select honeycomb1", 4)
        if HoneyComb:
             rs.MirrorObjects(HoneyComb, [0,0,0],[3.88201841817204,-5.50648415753585E-11,0],True)
             HoneyComb = rs.GetObjects("select honeycomb2", 4)
        if HoneyComb:
             rs.MirrorObjects(HoneyComb, [3.88201841799135,6.72385313643489,0],[5.82275900341455,3.31625892362967,0],True)
             HoneyComb = rs.GetObjects("select honeycomb3", 4)
        if HoneyComb:
             rs.MirrorObjects(HoneyComb, [5.82275900332047,-3.31625892379486,0],[3.8820184178006,-6.72385313654502,0],True)
             HoneyComb = rs.GetObjects("select honeycomb2 and 3", 4)
        if HoneyComb:
             rs.MirrorObjects(HoneyComb, [7.74784608112465,-3.80494392401555,0],[7.74784608123259,3.80494392379575,0],True)

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