<jupyter_start><jupyter_text>Draw a ShapesAttempt at programmatically drawing shapes.All units in mm. ```1``` = ```1 mm```.<jupyter_code>s = GCode.Shapes.Square()

s

lines = list()

_ = GCode.Shapes.Square(len_side=2.5, origin=[0, 0])
lines.append(_)

_ = GCode.Shapes.Square(len_side=5, origin=[2.5, 2.5])
lines.append(_)

def origin_calc(lines):
    if len(lines) == 0:
        o = 0
    else:
        o = np.sum(list(map(lambda s: s.len_side, lines)))
    return np.array([[o], [o]])

_ = GCode.Shapes.Square(len_side=10, origin=origin_calc(lines))
lines.append(_)

lines

origin_calc(list())

np.sum([2.5, 5, 10, 25.4])

sides = [2.5, 5, 10, 25.4, 25.4 / 4, 1]
np.sum(sides)

lines = list()

for side in sides:
    _ = GCode.Shapes.Square(len_side=side, origin=origin_calc(lines))
    lines.append(_)

prog = GCode.Program(lines=lines)

prog.lines

prog.generate_gcode()

prog.buffer<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17973856209150327, 'fraction_numerical': 0.0392156862745098, 'mean_word_length': 4.162921348314606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '341906', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 414, 'n_tokens_neox': 389, 'n_words': 73, 'path': 'Drawing/OldDrawing/Shapes-Copy4.ipynb', 'repo_name': 'jed-frey/python_cnc3018', 'size': '918'}