from solid import *
from solid.utils import *
import numpy as np


def make_model():
    hexagon_points = np.array([[1, 0],
                               [0.5, -0.866],
                               [-0.5, -0.866],
                               [-1, 0],
                               [-0.5, 0.866],
                               [0.5, 0.866]])

    hexagon = polygon(hexagon_points)

    hex_col = sum([translate([0, 2*i])(hexagon) for i in range(5)])
    hex_tile = sum([translate([1.73*i, 1*(i % 2)])(hex_col) for i in range(5)])

    hex_outline = square([7, 7]) - hex_tile

    return color("yellow")(linear_extrude(1)(hex_outline))


if __name__ == "__main__":
    o = make_model()
    scad_render_to_file(o, "output.scad")
