Skip to content

Instantly share code, notes, and snippets.

@Unrud
Last active February 20, 2021 02:07
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Unrud/61cfb145a9026b9bebab6ba41143373f to your computer and use it in GitHub Desktop.
// CNC-v3.2.scad - Open source CNC machine
// Project page: www.HomoFaciens.de
// Date: 2016-10-11
// Author: Norbert Heinz
// Modified by Unrud <unrud@outlook.com> (2018-10-08)
// Display Settings
SHOW_DRILLHOLES = false;
SHOW_BALL_BEARINGS = true;
SHOW_CROSS_BEAMS = true;
SHOW_LABELS = true;
SHOW_ASSEMBLED = false;
SHOW_MAIN_FRAME = true;
SHOW_X_AXIS = true;
SHOW_Y_AXIS = true;
SHOW_Z_AXIS = true;
DRILL_FRAGMENTS = 10;
BALL_BEARING_FRAGMENTS = 10;
// End Display Settings
// Model Settings
SQUARE_TUBE_WALL_THICKNESS = 2;
WITH_CROSS_BEAMS = true;
WITH_MOUNTING_PLATES = true;
// End Model Settings
// id, length, [[[drill position, drill diameter, flags], ...], ...]
SQUARE_TUBES = [
["F1", 820, [
// Top
[],
// Right
[],
// Bottom
[[10, 5], [190, 5], [390, 5], [590, 5], [790, 5]],
// Left
[[30, 5], [50, 5, "M"], [90, 5, "M"], [130, 5, "M"], [170, 5, "M"], [210, 5], [410, 5], [610, 5], [810, 5]]]],
["F2", 820, [
[],
[],
[[30, 5], [230, 5], [430, 5], [630, 5], [810, 5]],
[[10, 5], [210, 5], [410, 5], [610, 5], [650, 5, "M"], [690, 5, "M"], [730, 5, "M"], [770, 5, "M"], [790, 5]]]],
["F3", 300, [
[[10, 11], [250, 5, "C"], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "C"], [290, 7]],
[[30, 7], [270, 7]]]],
["F4", 300, [
[[10, 11], [50, 5, "C"], [250, 5, "C"], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "C"], [250, 5, "C"], [290, 7]],
[[30, 7], [270, 7]]]],
["F5", 300, [
[[10, 11], [50, 5, "C"], [250, 5, "C"], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "C"], [250, 5, "C"], [290, 7]],
[[30, 7], [270, 7]]]],
["F6", 300, [
[[10, 11], [50, 5, "C"], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "M"], [100, 5, "M"], [150, 5, "M"], [200, 5, "M"], [250, 5, "CM"], [290, 7]],
[[30, 7], [270, 7]]]],
["F7", 300, [
[[10, 11], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "M"], [100, 5, "M"], [150, 5, "M"], [200, 5, "M"], [250, 5, "M"], [290, 7]],
[[30, 7], [270, 7]]]],
["F8", 220, [
[[10, 5], [170, 5, "C"], [210, 7]],
[[10, 7], [30, 5, "C"], [190, 5]],
[[30, 5, "C"], [210, 11]],
[[10, 11], [170, 5, "C"]]]],
["F9", 220, [
[[10, 5], [30, 5, "C"], [170, 5, "C"], [210, 7]],
[[10, 7], [30, 5, "C"], [190, 5]],
[[30, 5, "C"], [170, 5, "C"], [210, 11]],
[[10, 11], [170, 5, "C"]]]],
["F10", 220, [
[[10, 5], [30, 5, "C"], [170, 5, "C"], [210, 7]],
[[10, 7], [30, 5, "C"], [190, 5]],
[[30, 5, "C"], [170, 5, "C"], [210, 11]],
[[10, 11], [170, 5, "C"]]]],
["F11", 220, [
[[10, 7], [190, 5, "C"], [210, 5]],
[[30, 5], [50, 5, "C"], [210, 7]],
[[10, 11], [50, 5, "C"]],
[[190, 5, "C"], [210, 11]]]],
["F12", 220, [
[[10, 7], [50, 5, "C"], [190, 5, "C"], [210, 5]],
[[30, 5], [50, 5, "C"], [210, 7]],
[[10, 11], [50, 5, "C"], [190, 5, "C"]],
[[190, 5, "C"], [210, 11]]]],
["F13", 220, [
[[10, 7], [50, 5, "C"], [190, 5, "C"], [210, 5]],
[[30, 5], [50, 5, "C"], [210, 7]],
[[10, 11], [50, 5, "C"], [190, 5, "C"]],
[[190, 5, "C"], [210, 11]]]],
["F14", 260, [
[[130, 5]],
[[130, 5]],
[[30, 5, "C"], [130, 5], [230, 5, "C"]],
[[10, 5], [250, 5]]]],
["F15", 260, [
[[130, 5]],
[[10, 5], [250, 5]],
[[30, 5, "C"], [230, 5, "C"]],
[[10, 5], [250, 5]]]],
["F16", 260, [
[[130, 5]],
[[10, 5], [250, 5]],
[[30, 5, "C"], [230, 5, "C"]],
[[10, 5], [250, 5]]]],
["F17", 260, [
[[30, 5, "M"], [70, 5, "M"], [110, 5, "M"], [130, 5], [150, 5, "M"], [190, 5, "M"], [230, 5, "M"]],
[[10, 5], [250, 5]],
[[30, 5, "C"], [230, 5, "C"]],
[[10, 5], [250, 5]]]],
["F18", 620, [
[],
[[10, 7], [110, 5], [210, 7], [310, 5], [410, 7], [510, 5], [610, 7]],
[],
[[10, 11], [210, 11], [410, 11], [610, 11]]]],
["F19", 820, [
[[30, 11], [230, 11], [430, 11], [630, 11], [810, 11]],
[],
[[30, 7], [190, 5], [230, 7], [390, 5], [430, 7], [590, 5], [630, 7], [810, 7]],
[[650, 5, "M"], [690, 5, "M"], [730, 5, "M"], [770, 5, "M"], [790, 5]]]],
["F20", 820, [
[[10, 11], [190, 11], [390, 11], [590, 11], [790, 11]],
[],
[[10, 7], [190, 7], [230, 5], [390, 7], [430, 5], [590, 7], [630, 5], [790, 7]],
[[30, 5], [50, 5, "M"], [90, 5, "M"], [130, 5, "M"], [170, 5, "M"]]]],
["F21", 800, [
[[10, 11], [50, 5, "C"], [215, 5, "C"], [550, 5, "C"], [590, 5], [610, 5, "C"], [750, 5, "C"], [790, 7]],
[[30, 5], [175, 5], [330, 5], [370, 5], [515, 5], [590, 7], [610, 5, "C"], [770, 5]],
[[10, 7], [50, 5, "C"], [155, 5, "C"], [195, 5], [310, 5, "C"], [350, 5], [370, 5, "C"], [610, 5, "C"], [750, 5, "C"], [790, 11]],
[[535, 5], [590, 11], [750, 5, "C"]]]],
["F22", 800, [
[[10, 7], [50, 5, "C"], [190, 5, "C"], [210, 5], [250, 5, "C"], [490, 5, "C"], [645, 5, "C"], [790, 11]],
[[30, 5], [50, 5, "C"], [210, 7], [285, 5], [430, 5], [470, 5], [625, 5], [770, 5]],
[[10, 11], [50, 5, "C"], [190, 5, "C"], [430, 5, "C"], [450, 5], [585, 5, "C"], [605, 5], [750, 5, "C"], [790, 7]],
[[190, 5, "C"], [210, 11], [265, 5]]]],
["F23", 800, [
[[10, 11], [155, 5, "C"], [310, 5, "C"], [370, 5, "C"], [590, 5], [610, 5, "C"], [790, 7]],
[[30, 5], [155, 5, "C"], [175, 5], [310, 5, "C"], [330, 5], [570, 5], [590, 5, "C"], [770, 5]],
[[10, 7], [50, 5, "C"], [195, 5], [215, 5, "C"], [350, 5], [550, 5, "C"], [750, 5, "C"], [790, 11]],
[[50, 5, "C"], [215, 5, "C"], [370, 5, "C"], [550, 5, "C"], [750, 5, "C"]]]],
["F24", 800, [
[[10, 7], [50, 5, "C"], [210, 5], [430, 5, "C"], [585, 5, "C"], [750, 5, "C"], [790, 11]],
[[30, 5], [50, 5, "C"], [230, 5], [470, 5], [585, 5, "C"], [625, 5], [750, 5, "C"], [770, 5]],
[[10, 11], [190, 5, "C"], [250, 5, "C"], [450, 5], [490, 5, "C"], [605, 5], [645, 5, "C"], [790, 7]],
[[210, 5, "C"], [250, 5, "C"], [430, 5, "C"], [490, 5, "C"], [645, 5, "C"]]]],
["F25", 450, [
[[30, 5], [260, 5], [440, 5]],
[[10, 5], [50, 5], [220, 5, "C"], [240, 5], [400, 5, "C"], [420, 5]],
[],
[[10, 5], [50, 5], [70, 5, "C"], [260, 5, "C"]]]],
["F26", 430, [
[[10, 5], [240, 7], [420, 7]],
[[10, 7]],
[[30, 5, "C"], [240, 11], [420, 11]],
[[10, 11], [220, 5], [400, 5]]]],
["F27", 430, [
[[10, 5], [240, 7], [420, 7]],
[[10, 11], [30, 5, "C"], [200, 5, "C"], [380, 5, "C"]],
[[200, 5, "C"], [240, 11], [420, 11]],
[[10, 7], [220, 5], [240, 5, "C"], [400, 5]]]],
["F28", 450, [
[[10, 5], [190, 5], [420, 5]],
[[30, 5], [190, 5, "C"], [210, 5], [380, 5, "C"], [400, 5], [440, 5]],
[],
[[50, 5, "C"], [230, 5, "C"], [400, 5], [440, 5]]]],
["F29", 430, [
[[10, 7], [190, 7], [420, 5]],
[[420, 7]],
[[10, 11], [190, 11], [400, 5, "C"]],
[[30, 5], [210, 5], [420, 11]]]],
["F30", 430, [
[[10, 7], [190, 7], [420, 5]],
[[190, 5, "C"], [230, 5, "C"], [400, 5, "C"], [420, 11]],
[[10, 11], [190, 11], [230, 5, "C"]],
[[30, 5], [50, 5, "C"], [210, 5], [420, 7]]]],
["F31", 260, [
[[30, 7], [230, 7]],
[[10, 11], [250, 11]],
[[30, 11], [230, 11]],
[[10, 7], [250, 7]]]],
["F32", 260, [
[[30, 11], [230, 11]],
[[10, 11], [250, 11]],
[[30, 7], [230, 7]],
[[10, 7], [250, 7]]]],
["F33", 260, [
[[30, 11], [230, 11]],
[[10, 11], [250, 11]],
[[30, 7], [230, 7]],
[[10, 7], [250, 7]]]],
["F34", 300, [
[[10, 11], [290, 11]],
[[30, 11], [270, 11]],
[[10, 7], [50, 5, "M"], [100, 5, "M"], [150, 5, "M"], [200, 5, "M"], [250, 5, "M"], [290, 7]],
[[30, 7], [270, 7]]]],
["F35", 260, [
[[30, 7], [230, 7]],
[[10, 11], [250, 11]],
[[30, 11], [230, 11]],
[[10, 7], [250, 7]]]],
["F36", 260, [
[[30, 11], [230, 11]],
[[10, 11], [250, 11]],
[[30, 7], [230, 7]],
[[10, 7], [250, 7]]]],
["F37", 260, [
[[30, 11], [230, 11]],
[[10, 11], [250, 11]],
[[30, 7], [230, 7]],
[[10, 7], [250, 7]]]],
["F38", 380, [
[[30, 11], [215, 11], [370, 11]],
[[10, 5], [50, 5]],
[[30, 7], [120, 5], [160, 5], [195, 5, "C"], [215, 7], [255, 5], [330, 5], [370, 7]],
[[10, 5], [50, 5]]]],
["F39", 380, [
[[10, 11], [165, 11], [350, 11]],
[[330, 5], [370, 5]],
[[10, 7], [50, 5], [125, 5], [165, 7], [185, 5, "C"], [220, 5], [260, 5], [350, 7]],
[[330, 5], [370, 5]]]],
["F40", 220, [
[[10, 5], [210, 5]],
[[110, 5]],
[[10, 5], [210, 5]],
[]]],
["F41", 220, [
[[10, 5], [210, 5]],
[[110, 5]],
[[10, 5], [210, 5]],
[]]],
["F42", 220, [
[[10, 5], [210, 5]],
[[110, 5]],
[[10, 5], [210, 5]],
[]]],
["F43", 320, [
[[10, 5]],
[[80, 11], [155, 5], [175, 11], [195, 5], [290, 11]],
[[10, 5]],
[[80, 7], [175, 7], [290, 7]]]],
["F44", 260, [
[[30, 7], [130, 7], [230, 7]],
[[10, 11], [250, 11]],
[[30, 11], [110, 5], [130, 11], [150, 5], [230, 11]],
[[10, 7], [250, 7]]]],
["F45", 260, [
[[30, 7], [130, 7], [230, 7]],
[[10, 7], [250, 7]],
[[30, 11], [130, 11], [230, 11]],
[[10, 11], [250, 11]]]],
["F46", 100, [
[],
[[15, 11], [50, 5], [90, 5]],
[],
[[15, 11], [50, 5], [90, 5]]]],
["F47", 260, [
[[30, 11], [130, 11], [230, 11]],
[[10, 11], [250, 11]],
[[30, 7], [130, 7], [230, 7]],
[[10, 7], [250, 7]]]],
["F48", 260, [
[[30, 11], [130, 11], [230, 11]],
[[10, 7], [250, 7]],
[[30, 7], [130, 7], [230, 7]],
[[10, 11], [250, 11]]]],
["F49", 35, [
[],
[[10, 11], [25, 5]],
[],
[[10, 11], [25, 5]]]],
["F50", 260, [
[],
[[10, 7], [130, 11], [250, 7]],
[],
[[10, 11], [130, 11], [250, 11]]]],
["F51", 260, [
[],
[[10, 11], [250, 11]],
[],
[[10, 7], [250, 7]]]],
["F52", 100, [
[],
[[15, 11], [70, 11]],
[],
[[15, 11], [70, 7], [90, 5]]]],
["X1", 290, [
[[10, 11], [280, 11]],
[[30, 7], [50, 5], [145, 11], [240, 5], [260, 7]],
[[10, 7], [85, 5], [100, 5], [170, 11], [190, 5], [280, 7]],
[[30, 11], [45, 5], [65, 5], [85, 5], [125, 5], [145, 11], [165, 5], [205, 5], [225, 5], [245, 5], [260, 11]]]],
["X2", 290, [
[[10, 11], [280, 11]],
[[30, 11], [45, 5], [65, 5], [85, 5], [125, 5], [145, 11], [165, 5], [205, 5], [225, 5], [245, 5], [260, 11]],
[[10, 7], [85, 5], [170, 11], [280, 7]],
[[30, 7], [50, 5], [145, 11], [240, 5], [260, 7]]]],
["X3", 330, [
[],
[[10, 5], [320, 5]],
[],
[[10, 5], [320, 5]]]],
["X4", 410, [
[[10, 5], [30, 5], [65, 5], [105, 5], [145, 5], [185, 5], [225, 5], [265, 5], [305, 5], [345, 5], [380, 5], [400, 5]],
[[10, 7], [400, 7]],
[],
[[10, 11], [400, 11]]]],
["X5", 410, [
[[10, 5], [30, 5], [65, 5], [105, 5], [145, 5], [185, 5], [225, 5], [265, 5], [305, 5], [345, 5], [380, 5], [400, 5]],
[[10, 11], [400, 11]],
[],
[[10, 7], [400, 7]]]],
["X6", 105, [
[[30, 5]],
[[10, 5]],
[[10, 5], [90, 11]],
[]]],
["X7", 105, [
[[30, 5]],
[],
[[10, 5], [90, 11]],
[[10, 5]]]],
["X8", 105, [
[[30, 5]],
[[10, 5]],
[[10, 5], [90, 11]],
[]]],
["X9", 105, [
[[30, 5]],
[],
[[10, 5], [90, 11]],
[[10, 5]]]],
["X10", 410, [
[[50, 7], [360, 7]],
[[10, 8.5], [400, 8.5]],
[[50, 5], [360, 5]],
[[10, 11], [400, 11]]]],
["X11", 410, [
[[50, 7], [360, 7]],
[[10, 11], [400, 11]],
[[50, 5], [360, 5]],
[[10, 8.5], [400, 8.5]]]],
["X12", 370, [
[[10, 11], [360, 11]],
[[50, 7], [320, 7]],
[[10, 8.5], [360, 8.5]],
[[50, 5], [320, 5]]]],
["X13", 370, [
[[10, 7], [360, 7]],
[[50, 7], [320, 7]],
[[10, 7], [360, 7]],
[[50, 7], [320, 7]]]],
["X14", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X15", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X16", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X17", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X18", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X19", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X20", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X21", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["X22", 290, [
[for (i = [0 : 7]) [10 + 270/7 * i, 5]],
[],
[[10, 5], [280, 5]],
[]]],
["Y1", 760, [
[],
[[30, 5], [180, 7], [220, 5], [270, 5], [350, 11], [430, 5], [480, 5], [520, 7], [640, 5], [680, 5], [710, 7], [750, 7]],
[[305, 5], [395, 5]],
[[180, 11], [350, 11], [520, 11], [710, 11], [750, 11]]]],
["Y2", 760, [
[],
[[180, 11], [350, 11], [520, 11], [710, 11], [750, 11]],
[],
[[30, 5], [180, 7], [220, 5], [270, 5], [350, 11], [430, 5], [480, 5], [520, 7], [640, 5], [680, 5], [710, 7], [750, 7]]]],
["Y3", 160, [
[[80, 5]],
[[10, 5], [150, 5]],
[[80, 5]],
[[80, 5]]]],
["Y4", 160, [
[[80, 5]],
[[10, 5], [150, 5]],
[],
[[10, 5], [150, 5]]]],
["Y5", 120, [
[[60, 5]],
[[10, 5], [110, 5]],
[],
[[10, 5], [110, 5]]]],
["Y6", 180, [
[],
[[10, 11], [70, 5], [90, 11], [110, 5], [170, 11]],
[[30, 5], [115, 11]],
[[10, 7], [90, 11], [170, 7]]]],
["Y7", 180, [
[],
[[10, 7], [90, 11], [170, 7]],
[[30, 5], [115, 11]],
[[10, 11], [70, 5], [90, 11], [110, 5], [170, 11]]]],
["Y8", 160, [
[[80, 5]],
[[10, 5], [150, 5]],
[],
[[10, 5], [150, 5]]]],
["Y9", 160, [
[[80, 5]],
[[10, 5], [150, 5]],
[],
[[10, 5], [150, 5]]]],
["Y10", 160, [
[[80, 5]],
[[10, 5], [150, 5]],
[],
[[10, 5], [150, 5]]]],
["Y11", 740, [
[[10, 11], [200, 11], [350, 11], [500, 11], [660, 11], [730, 11]],
[],
[[10, 7], [200, 7], [350, 7], [500, 7], [660, 7], [730, 7]],
[]]],
["Y12", 75, [
[[10, 11], [65, 11]],
[[65, 5]],
[[10, 7], [65, 7]],
[]]],
["Y13", 75, [
[[10, 11], [65, 11]],
[],
[[10, 7], [65, 7]],
[[65, 5]]]],
["Y14", 260, [
[],
[[60, 5], [130, 11], [200, 5]],
[],
[[60, 5], [130, 11], [200, 5]]]],
["Y15", 75, [
[[10, 11], [65, 11]],
[[65, 5]],
[[10, 7], [65, 7]],
[]]],
["Y16", 190, [
[[125, 11], [180, 11]],
[],
[[125, 7], [180, 7]],
[[180, 5]]]],
["Y17", 140, [
[[10, 5]],
[[10, 7], [40, 11], [130, 5]],
[],
[[10, 11]]]],
["Y18", 140, [
[[10, 5]],
[[10, 11]],
[],
[[10, 7], [40, 11], [130, 5]]]],
["Y19", 200, [
[[10, 11], [190, 11]],
[[50, 7], [150, 7]],
[[10, 8.5], [190, 8.5]],
[[50, 5], [150, 5]]]],
["Y20", 160, [
[[10, 7], [150, 7]],
[[30, 7], [130, 7]],
[[10, 11], [150, 11]],
[[30, 7], [130, 7]]]],
["Y21", 140, [
[[10, 5]],
[[10, 11]],
[],
[[10, 7], [130, 5], [40, 11]]]],
["Y22", 140, [
[[10, 5]],
[[10, 7], [40, 11], [130, 5]],
[],
[[10, 11]]]],
["Y23", 200, [
[[10, 8.5], [190, 8.5]],
[[50, 7], [150, 7]],
[[10, 11], [190, 11]],
[[50, 5], [150, 5]]]],
["Y24", 160, [
[[10, 11], [150, 11]],
[[30, 7], [130, 7]],
[[10, 7], [150, 7]],
[[30, 7], [130, 7]]]],
["Y25", 160, [
[[10, 11], [150, 11]],
[[50, 5], [110, 5]],
[[10, 8.5], [150, 8.5]],
[[50, 7], [110, 7]]]],
["Y26", 160, [
[[10, 7], [150, 7]],
[[50, 7], [110, 7]],
[[10, 11], [150, 11]],
[[50, 7], [110, 7]]]],
["Y27", 100, [
[[15, 11], [70, 11]],
[],
[[15, 11], [70, 7], [90, 5]],
[]]],
["Z1", 310, [
[[10, 7], [50, 5], [70, 5], [110, 5], [200, 5], [240, 5], [260, 5], [300, 7]],
[for (i = [0 : 5]) [30 + 250/5 * i, 5]],
[[10, 11], [300, 11]],
[[130, 11], [220, 5]]]],
["Z2", 310, [
[[10, 11], [155, 11], [300, 11]],
[for (i = [0 : 5]) [30 + 250/5 * i, 5]],
[[10, 7], [50, 5], [70, 5], [110, 5], [155, 11], [200, 5], [240, 5], [260, 5], [300, 7]],
[[110, 5], [130, 11], [200, 5], [220, 5]]]],
["Z3", 180, [
[for (i = [0 : 3]) [20 + 140/3 * i, 5]],
[[10, 5], [170, 5]],
[],
[[10, 5], [170, 5]]]],
["Z4", 180, [
[for (i = [0 : 3]) [20 + 140/3 * i, 5]],
[[10, 5], [170, 5]],
[],
[[10, 5], [170, 5]]]],
["Z5", 180, [
[for (i = [0 : 3]) [20 + 140/3 * i, 5]],
[[10, 5], [170, 5]],
[],
[[10, 5], [170, 5]]]],
["Z6", 180, [
[for (i = [0 : 3]) [20 + 140/3 * i, 5]],
[[10, 5], [170, 5]],
[],
[[10, 5], [170, 5]]]],
["Z7", 140, [
[],
[[10, 11], [130, 11]],
[[10, 5]],
[[10, 7], [40, 11], [130, 7]]]],
["Z8", 140, [
[[10, 5]],
[[10, 11], [130, 11]],
[],
[[10, 7], [40, 11], [130, 7]]]],
["Z9", 140, [
[[10, 5]],
[[10, 7], [40, 11], [130, 7]],
[],
[[10, 11], [130, 11]]]],
["Z10", 140, [
[],
[[10, 7], [40, 11], [130, 7]],
[[10, 5]],
[[10, 11], [130, 11]]]],
["Z11", 180, [
[[10, 5], [170, 5]],
[[50, 7], [130, 7]],
[],
[[50, 7], [130, 7]]]],
["Z12", 180, [
[[10, 5], [170, 5]],
[[50, 7], [130, 7]],
[],
[[50, 7], [130, 7]]]],
["Z13", 180, [
[[10, 8.5], [170, 8.5]],
[[50, 7], [130, 7]],
[[10, 11], [170, 11]],
[[50, 5], [130, 5]]]],
["Z14", 180, [
[[10, 8.5], [170, 8.5]],
[[50, 5], [130, 5]],
[[10, 11], [170, 11]],
[[50, 7], [130, 7]]]],
["Z15", 220, [
[[10, 7], [210, 7]],
[[50, 7], [170, 7]],
[[10, 11], [210, 11]],
[[50, 7], [170, 7]]]],
["Z16", 220, [
[[10, 11], [210, 11]],
[[50, 5], [170, 5]],
[[10, 8.5], [210, 8.5]],
[[50, 7], [170, 7]]]]];
// id, length, [[drill position, drill diameter], ...]
CROSS_BEAMS = [
["C1", 293, [[7.5, 7], [146.5, 5], [285.5, 7]]],
["C2", 293, [[7.5, 7], [146.5, 7], [285.5, 7]]],
["C3", 293, [[7.5, 7], [146.5, 5], [285.5, 7]]],
["C4", 293, [[7.5, 7], [146.5, 7], [285.5, 7]]],
["C5", 293, [[7.5, 7], [146.5, 5], [285.5, 7]]],
["C6", 293, [[7.5, 7], [146.5, 7], [285.5, 7]]],
["C7", 293, [[7.5, 7], [146.5, 5], [285.5, 7]]],
["C8", 293, [[7.5, 7], [146.5, 7], [285.5, 7]]],
["C9", 298, [[7.5, 7], [149, 5], [290.5, 7]]],
["C10", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C11", 298, [[7.5, 7], [149, 5], [290.5, 7]]],
["C12", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C13", 298, [[7.5, 7], [149, 5], [290.5, 7]]],
["C14", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C15", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C16", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C17", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C18", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C19", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C20", 298, [[7.5, 7], [149, 7], [290.5, 7]]],
["C21", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C22", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C23", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C24", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C25", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C26", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C27", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C28", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C29", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C30", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C31", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C32", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C33", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C34", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C35", 265, [[7.5, 7], [132.5, 7], [257.5, 7]]],
["C36", 265, [[7.5, 7], [132.5, 5], [257.5, 7]]],
["C37", 259, [[7.5, 7], [129.5, 5], [251.5, 7]]],
["C38", 259, [[7.5, 7], [129.5, 7], [251.5, 7]]],
["C39", 277, [[7.5, 7], [138.5, 7], [269.5, 7]]],
["C40", 277, [[7.5, 7], [138.5, 5], [269.5, 7]]],
["C41", 223, [[7.5, 7], [111.5, 5], [215.5, 7]]],
["C42", 223, [[7.5, 7], [111.5, 7], [215.5, 7]]],
["C43", 219, [[7.5, 7], [109.5, 5], [211.5, 7]]],
["C44", 219, [[7.5, 7], [109.5, 7], [211.5, 7]]],
["C45", 270, [[7.5, 7], [135, 7], [262.5, 7]]],
["C46", 270, [[7.5, 7], [135, 5], [262.5, 7]]],
["C47", 243, [[7.5, 7], [121.5, 7], [235.5, 7]]],
["C48", 243, [[7.5, 7], [121.5, 5], [235.5, 7]]],
["C49", 223, [[7.5, 7], [111.5, 7], [215.5, 7]]],
["C50", 223, [[7.5, 7], [111.5, 5], [215.5, 7]]],
["C51", 219, [[7.5, 7], [109.5, 7], [211.5, 7]]],
["C52", 219, [[7.5, 7], [109.5, 5], [211.5, 7]]],
["C53", 270, [[7.5, 7], [135, 7], [262.5, 7]]],
["C54", 270, [[7.5, 7], [135, 5], [262.5, 7]]],
["C55", 243, [[7.5, 7], [121.5, 5], [235.5, 7]]],
["C56", 243, [[7.5, 7], [121.5, 7], [235.5, 7]]],
["C57", 277, [[7.5, 7], [269.5, 7]]],
["C58", 245, [[7.5, 7], [237.5, 7]]],
["C59", 277, [[7.5, 7], [269.5, 7]]],
["C60", 245, [[7.5, 7], [237.5, 7]]],
["C61", 277, [[7.5, 7], [138.5, 5], [269.5, 7]]],
["C62", 277, [[7.5, 7], [138.5, 7], [269.5, 7]]],
["C63", 273, [[7.5, 7], [136.5, 5], [265.5, 7]]],
["C64", 273, [[7.5, 7], [136.5, 7], [265.5, 7]]],
["C65", 315, [[7.5, 7], [157.5, 5], [307.5, 7]]],
["C66", 315, [[7.5, 7], [157.5, 7], [307.5, 7]]],
["C67", 303, [[7.5, 7], [151.5, 7], [295.5, 7]]],
["C68", 303, [[7.5, 7], [151.5, 5], [295.5, 7]]],
["C69", 295, [[7.5, 7], [147.5, 7], [287.5, 7]]],
["C70", 295, [[7.5, 7], [147.5, 5], [287.5, 7]]],
["T1", 410, [[10, 7], [45, 7], [65, 7], [85, 7], [105, 7], [125, 7], [145, 7], [165, 7], [185, 7], [205, 7], [225, 7], [245, 7], [265, 7], [285, 7], [305, 7], [325, 7], [345, 7], [365, 7], [400, 7]]],
["T2", 410, [[10, 7], [45, 7], [65, 7], [85, 7], [105, 7], [125, 7], [145, 7], [165, 7], [185, 7], [205, 7], [225, 7], [245, 7], [265, 7], [285, 7], [305, 7], [325, 7], [345, 7], [365, 7], [400, 7]]]];
function get(db, key) = [for (v = db) if (v[0] == key) v][0];
function join(strings) =
len(strings) == 0
? ""
: len(strings) == 1
? strings[0]
: str(strings[0], join([for (i = [1 : len(strings) - 1]) strings[i]]));
function split_label(label) = let (
left = join([
for (i = [0 : len(label) - 1])
if (len([
for (j = [0 : i])
if (label[j] == " ") j]) == i + 1)
label[i]]),
right = join([
for (i = [0 : len(label) - 1])
if (len([
for (j = [0 : i])
if (label[len(label) - j - 1] == " ") j]) == i + 1)
label[len(label) - i - 1]]),
id = join([
for (i = [0 : len(label) - 1])
if (len(left) <= i && i < len(label) - len(right)) label[i]])) [
left, id, right];
function has_flag(flags, flag) = len([for (i = [0 : len(flags) - 1]) if (flags[i] == flag) i]) != 0;
module label(label, offset) {
label = split_label(label);
left = label[0];
id = label[1];
right = label[2];
lalign = len(left) > 0 && len(right) > 0 ? "center" : len(right) > 0 ? "right" : "left";
ralign = len(left) > 0 && len(right) > 0 ? "center" : len(right) > 0 ? "left" : "right";
translate([0, 0, offset]) linear_extrude(0.1)
text(join([left, id, right]), 20, halign = lalign, valign = "center");
rotate([0, 180, 0]) translate([0, 0, offset]) linear_extrude(1)
text(join([right, id, left]), 20, halign = ralign, valign = "center");
}
module square_tube(label) {
id = split_label(label)[1];
entry = get(SQUARE_TUBES, id);
length = entry[1];
difference() {
outer = 20;
inner = outer - SQUARE_TUBE_WALL_THICKNESS * 2;
cube([length, outer, outer], center=true);
cube([length + 1, inner, inner], center=true);
if (SHOW_DRILLHOLES) for (side = [0, 1, 2, 3])
rotate([90 * side, 0, 0])
for (h = entry[2][side]) {
p = h[0];
r = h[1]/2;
flags = h[2];
if (flags == undef || flags == "" ||
has_flag(flags, "M") && WITH_MOUNTING_PLATES ||
has_flag(flags, "C") && WITH_CROSS_BEAMS) {
translate([p - length/2, 0, inner/2 + SQUARE_TUBE_WALL_THICKNESS/2])
cylinder($fn=DRILL_FRAGMENTS, h=SQUARE_TUBE_WALL_THICKNESS + 1, r1=r, r2=r, center=true);
}
};
}
if (SHOW_LABELS) color([1.0, 0.0, 0.0, 1.0]) label(label, 10);
}
module ball_bearing(inner, outer, width) {
if (SHOW_BALL_BEARINGS) difference() {
color([0.0, 1.0, 0.0, 1.0]) cylinder($fn=BALL_BEARING_FRAGMENTS, h=width, r1=outer/2, r2=outer/2, center=true);
cylinder($fn=BALL_BEARING_FRAGMENTS, h=width+1, r1=inner/2, r2=inner/2, center=true);
}
}
module cross_beam(label) {
id = split_label(label)[1];
if (id[0] == "C" && WITH_CROSS_BEAMS && SHOW_CROSS_BEAMS ||
id[0] != "C") {
entry = get(CROSS_BEAMS, id);
length = entry[1];
difference() {
cube([length, 20, 4], center=true);
if (SHOW_DRILLHOLES) for (h = entry[2]) {
p = h[0];
r = h[1]/2;
translate([p - length/2, 0, 0])
cylinder($fn=DRILL_FRAGMENTS, h=5, r1=r, r2=r, center=true);
}
}
if (SHOW_LABELS) color([0.0, 1.0, 1.0, 1.0]) label(label, 2);
}
}
//Z axis +++++++++++++++++++++++++++++++++++++++++++++++++++++
if (SHOW_Z_AXIS) translate([SHOW_ASSEMBLED ? 0 : 1000,-75,370]) {
translate([0,0,0]) square_tube(" Z1");
translate([0,0,200]) square_tube(" Z2");
translate([-125,0,100]) rotate([180, 90, 90]) square_tube("Z3 ");
translate([-65,0,100]) rotate([180, 90, 90]) square_tube("Z4 ");
translate([65,0,100]) rotate([180, 90, 90]) square_tube("Z5 ");
translate([125,0,100]) rotate([180, 90, 90]) square_tube("Z6 ");
//Ball bearings middle guide
translate([25,30,200]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([-25,30,200]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([25,30,0]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([-25,30,0]) rotate([90,90,0]) ball_bearing(10, 30, 10);
//Ball bearing mount 1
translate([145,60,20]) rotate([0, 0, 90]) square_tube(" Z7 ");
//Ball bearing
translate([125,30,20]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([125,80,20]) rotate([90,0,90]) ball_bearing(10, 30, 10);
//Ball bearing mount 2
translate([145,60,180]) rotate([0, 0, 90]) square_tube(" Z8 ");
//Ball bearing
translate([125,30,180]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([125,80,180]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-125,120,100]) rotate([270, 90, 90]) square_tube(" Z12 ");
translate([-125,80,100]) rotate([270, 90, 90]) square_tube(" Z13 ");
//Ball bearing mount 3
translate([-145,60,180]) rotate([0, 0, 90]) square_tube(" Z9 ");
//Ball bearing
translate([-125,30,180]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-125,80,180]) rotate([90,0,90]) ball_bearing(10, 30, 10);
//Ball bearing mount 4
translate([-145,60,20]) rotate([0, 0, 90]) square_tube(" Z10 ");
//Ball bearing
translate([-125,30,20]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-125,80,20]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([125,120,100]) rotate([90, 90, 90]) square_tube(" Z11 ");
translate([125,80,100]) rotate([90, 90, 90]) square_tube(" Z14 ");
translate([65,30,100]) rotate([180, 90, 90]) square_tube("Z15 ");
translate([25,30,100]) rotate([180, 90, 90]) square_tube("Z16 ");
}//End Z axis -----------------------------------------------
//X axis ++++++++++++++++++++++++++++++++++++++++++++++++++
if (SHOW_X_AXIS) translate([SHOW_ASSEMBLED ? -125 : 877,SHOW_ASSEMBLED ? 10 : -490,200]) {
translate([175,0,10]) rotate([0, 0, 90]) square_tube("X1 ");
translate([-175,0,10]) rotate([0, 0, 90]) square_tube("X2 ");
translate([0,0,10]) square_tube("X3 ");
translate([0,135,-10]) square_tube("X4 ");
translate([0,-135,-10]) square_tube("X5 ");
//Ball bearing
translate([-175,25,-20]) ball_bearing(10, 30, 10);
translate([-175,-25,-20]) ball_bearing(10, 30, 10);
translate([175,25,-20]) ball_bearing(10, 30, 10);
translate([175,-25,-20]) ball_bearing(10, 30, 10);
//Ball bearing mount 1
translate([-195,115,-32.5]) rotate([0, 90, 90]) square_tube(" X6");
//Ball bearing
translate([-195,95,-20]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([-195,95,-70]) rotate([90,90,0]) ball_bearing(10, 30, 10);
//Ball bearing mount 2
translate([195,115,-32.5]) rotate([0, 90, 90]) square_tube(" X7");
//Ball bearing
translate([195,95,-20]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([195,95,-70]) rotate([90,90,0]) ball_bearing(10, 30, 10);
//Ball bearing mount 3
translate([195,-115,-32.5]) rotate([180, 90, 90]) square_tube(" X8");
//Ball bearing
translate([195,-95,-20]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([195,-95,-70]) rotate([90,90,0]) ball_bearing(10, 30, 10);
//Ball bearing mount 4
translate([-195,-115,-32.5]) rotate([180, 90, 90]) square_tube(" X9");
//Ball bearing
translate([-195,-95,-20]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([-195,-95,-70]) rotate([90,90,0]) ball_bearing(10, 30, 10);
translate([0,-95,-20]) square_tube("X10 ");
translate([0,95,-20]) square_tube("X11 ");
translate([0,-25,-20]) square_tube("X12 ");
translate([0,-60,-20]) square_tube("X13 ");
//Table
translate([0,135,38]) cross_beam("T1 ");
translate([0,-135,38]) cross_beam("T2 ");
translate([160,0,50]) rotate([0, 0, 90]) square_tube("X14 ");
translate([120,0,50]) rotate([0, 0, 90]) square_tube("X15 ");
translate([80,0,50]) rotate([0, 0, 90]) square_tube("X16 ");
translate([40,0,50]) rotate([0, 0, 90]) square_tube("X17 ");
translate([0,0,50]) rotate([0, 0, 90]) square_tube("X18 ");
translate([-40,0,50]) rotate([0, 0, 90]) square_tube("X19 ");
translate([-80,0,50]) rotate([0, 0, 90]) square_tube("X20 ");
translate([-120,0,50]) rotate([0, 0, 90]) square_tube("X21 ");
translate([-160,0,50]) rotate([0, 0, 90]) square_tube("X22 ");
}//End X-axis ---------------------------------------------------
//Y axis ++++++++++++++++++++++++++++++++++++++++++++++++++
if (SHOW_Y_AXIS) translate([SHOW_ASSEMBLED ? 0 : 1000,10,155]) {
translate([30,90,0]) square_tube("Y1 ");
translate([30,-90,0]) square_tube("Y2 ");
translate([20,0,20]) square_tube("Y11 ");
//Ladder
translate([-340,0,0]) rotate([0, 0, 90]) square_tube("Y3 ");
translate([-150,0,0]) rotate([0, 0, 90]) square_tube("Y4 ");
translate([0,0,0]) rotate([0, 0, 90]) square_tube("Y5 ");
translate([0,70,0]) square_tube(" Y6 ");
translate([0,-70,0]) square_tube(" Y7 ");
translate([150,0,0]) rotate([0, 0, 90]) square_tube("Y8 ");
translate([310,0,0]) rotate([0, 0, 90]) square_tube("Y9 ");
translate([380,0,0]) rotate([0, 0, 90]) square_tube("Y10 ");
//Free end thread
translate([-360,0,20]) rotate([90, 90, 270]) square_tube(" Y27 ");
//Ball bearing
translate([-373,0,55]) rotate([90,0,90]) ball_bearing(6, 19, 6);
//Fixed end thread
translate([380,0,55]) rotate([0, 0, 90]) square_tube("Y14 ");
translate([400,70,85]) rotate([90, 90, 90]) square_tube("Y16");
translate([400,-70,27.5]) rotate([90, 90, 90]) square_tube(" Y15 ");
translate([360,70,27.5]) rotate([90, 90, 270]) square_tube(" Y12 ");
translate([360,-70,27.5]) rotate([90, 90, 270]) square_tube(" Y13 ");
//Ball bearing
translate([367,0,55]) rotate([90,0,90]) ball_bearing(6, 19, 6);
translate([393,0,55]) rotate([90,0,90]) ball_bearing(6, 19, 6);
//Ball bearing mount 1
translate([-170,70,-60]) rotate([90, 90, 180]) square_tube(" Y17 ");
//Ball bearing
translate([-150,70,-30]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-150,90,-80]) rotate([90,0,90]) ball_bearing(10, 30, 10);
//Ball bearing mount 2
translate([-170,-70,-60]) rotate([90, 90, 0]) square_tube(" Y18 ");
//Ball bearing
translate([-150,-70,-30]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-150,-90,-80]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([-150,0,-80]) rotate([90, 0, 270]) square_tube(" Y19 ");
translate([-150,0,-120]) rotate([90, 0, 270]) square_tube(" Y20 ");
//Ball bearing mount 3
translate([170,-70,-60]) rotate([90, 90, 0]) square_tube(" Y22 ");
//Ball bearing
translate([150,-70,-30]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([150,-90,-80]) rotate([90,0,90]) ball_bearing(10, 30, 10);
//Ball bearing mount 4
translate([170,70,-60]) rotate([90, 90, 180]) square_tube(" Y21 ");
//Ball bearing
translate([150,70,-30]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([150,90,-80]) rotate([90,0,90]) ball_bearing(10, 30, 10);
translate([150,0,-120]) rotate([90, 0, 270]) square_tube(" Y24 ");
translate([150,0,-80]) rotate([90, 0, 270]) square_tube(" Y23 ");
translate([-60,0,-24]) rotate([0, 0, 90]) square_tube("Y26 ");
translate([-25,0,-24]) rotate([0, 0, 90]) square_tube("Y25 ");
//Ball bearing mount 5
//Ball bearing
translate([25,70,-25]) ball_bearing(10, 30, 10);
translate([-25,70,-25]) ball_bearing(10, 30, 10);
//Ball bearing mount 6
//Ball bearing
translate([25,-70,-25]) ball_bearing(10, 30, 10);
translate([-25,-70,-25]) ball_bearing(10, 30, 10);
}//End Y axis ---------------------------------------------------
//Main frame +++++++++++++++++++++++++++++++++++++++++++++++++++++
if (SHOW_MAIN_FRAME) translate([0,0,0]) {
translate([-140,-10,-100]) rotate([90, 0, 270]) square_tube("F1 ");
translate([140,-10,-100]) rotate([90, 0, 90]) square_tube("F2 ");
translate([140,-10,100]) rotate([90, 0, 90]) square_tube("F19 ");
translate([-140,-10,100]) rotate([90, 0, 270]) square_tube("F20 ");
//Middle guide Y axis
translate([0,-110,120]) rotate([90, 0, 90]) square_tube("F18 ");
//Fixed end thread Y axis
translate([0,230,155]) square_tube("F50 ");
translate([0,182 + (WITH_CROSS_BEAMS ? 0 : 8),175]) square_tube("F51 ");
//Ball bearing
translate([0,217,155]) rotate([90,90,0]) ball_bearing(6, 19, 6);
translate([0,243,155]) rotate([90,90,0]) ball_bearing(6, 19, 6);
//Free end thread Y axis
translate([0,-430,120]) rotate([0, 90, 0]) square_tube(" F52 ");
//Ball bearing
translate([0,-443,155]) rotate([90,90,0]) ball_bearing(6, 19, 6);
//Fixed end thread Z axis
translate([0,-40,660]) square_tube(" F44");
translate([0,0,660]) square_tube(" F45");
translate([0,-40,700]) square_tube(" F47");
translate([0,0,700]) square_tube(" F48");
translate([0,-40,680]) rotate([90, 0, 90]) square_tube(" F46 ");
//Ball bearing
translate([0,-75,667]) ball_bearing(6, 19, 6);
translate([0,-75,693]) ball_bearing(6, 19, 6);
//Free end thread Z axis
translate([0,-67.5,475]) rotate([90, 0, 90]) square_tube(" F49 ");
//Ball bearing
translate([0,-75,462]) ball_bearing(6, 19, 6);
//Ladder Z axis
translate([0,-20,360]) square_tube(" F40");
translate([0,-20,475]) square_tube(" F41");
translate([0,-20,570]) square_tube(" F42");
translate([120,-20,520]) rotate([0, 90, 0]) square_tube("F38 ");
translate([-120,-20,520]) rotate([0, 270, 0]) square_tube("F39 ");
//Middle guide Z axis
translate([0,-40,490]) rotate([0, 90, 0]) square_tube("F43 ");
//Ladder Y axis
translate([0,-410,100]) square_tube(" F14");
translate([0,-210,100]) square_tube(" F15");
translate([0,-10,100]) square_tube(" F16");
translate([0,190,100]) square_tube(" F17");
//Bottom ladder
translate([0,-410,-80]) square_tube(" F3");
translate([0,-210,-80]) square_tube(" F4");
translate([0,-10,-80]) square_tube(" F5");
translate([0,190,-80]) square_tube(" F6");
translate([0,370,-80]) square_tube(" F7");
//vertical ladder
//right
translate([120,-390,0]) rotate([0, 90, 0]) square_tube("F8 ");
translate([120,-190,0]) rotate([0, 90, 0]) square_tube("F9 ");
translate([120,10,0]) rotate([0, 90, 0]) square_tube(" F10 ");
//Left
translate([-120,-390,0]) rotate([0, 270, 0]) square_tube(" F11 ");
translate([-120,-190,0]) rotate([0, 270, 0]) square_tube(" F12 ");
translate([-120,10,0]) rotate([0, 270, 0]) square_tube(" F13 ");
//Tower
translate([120,390,290]) rotate([0, 90, 0]) square_tube("F23 ");
translate([-120,390,290]) rotate([0, 270, 0]) square_tube("F24 ");
translate([120,210,290]) rotate([0, 90, 0]) square_tube("F21 ");
translate([-120,210,290]) rotate([0, 270, 0]) square_tube("F22 ");
//Side ladders tower
//right
translate([100,175,680]) rotate([90, 0, 90]) square_tube("F25 ");
translate([100,185,495]) rotate([90, 0, 90]) square_tube("F26 ");
translate([100,185,340]) rotate([90, 0, 90]) square_tube("F27 ");
//Left. . (7,651 bytes) (
translate([-100,175,680]) rotate([90, 0, 270]) square_tube("F28 ");
translate([-100,185,495]) rotate([90, 0, 270]) square_tube("F29 ");
translate([-100,185,340]) rotate([90, 0, 270]) square_tube("F30 ");
//Rear
translate([0,370,660]) square_tube(" F31 ");
translate([0,370,515]) square_tube(" F32 ");
translate([0,370,360]) square_tube(" F33 ");
translate([0,370,120]) square_tube(" F34 ");
//Middle ladder
translate([0,190,660]) square_tube(" F35 ");
translate([0,190,515]) square_tube(" F36 ");
translate([0,190,360]) square_tube(" F37 ");
//Cross beams
//Rear
//Hole distance 26,196373795
translate([0,378,587.5]) rotate([0,23.629377731,0]) rotate([90, 0, 180]) cross_beam("C61 ");
translate([0,402,587.5]) rotate([0,-23.629377731,0]) rotate([90, 0, 180]) cross_beam("C62 ");
//Hole distance 25,811818998
translate([0,378,427.5]) rotate([0,21.595310449,0]) rotate([90, 0, 180]) cross_beam("C63 ");
translate([0,402,427.5]) rotate([0,-21.595310449,0]) rotate([90, 0, 180]) cross_beam("C64 ");
//Hole distance 30
translate([0,402,230]) rotate([0,36.869897646,0]) rotate([90, 0, 180]) cross_beam("C65 ");
translate([0,406,230]) rotate([0,-36.869897646,0]) rotate([90, 0, 180]) cross_beam("C66 ");
//Hole distance 28,844410204
translate([0,402,20]) rotate([0,33.690067526,0]) rotate([90, 0, 180]) cross_beam("C67 ");
translate([0,378,20]) rotate([0,-33.690067526,0]) rotate([90, 0, 180]) cross_beam("C68 ");
translate([0,194,248]) rotate([0,31.13897244,0]) rotate([90, 0, 0]) cross_beam("C69 ");
translate([0,198,248]) rotate([0,-31.13897244,0]) rotate([90, 0, 0]) cross_beam("C70 ");
//Center
//Hole distance 27,784887979
translate([0,222,10]) rotate([0,30.256437164,0]) rotate([90, 0, 0]) cross_beam("C1 ");
translate([0,198,10]) rotate([0,-30.256437164,0]) rotate([90, 0, 0]) cross_beam("C2 ");
translate([0,22,10]) rotate([0,30.256437164,0]) rotate([90, 0, 0]) cross_beam("C3 ");
translate([0,-2,10]) rotate([0,-30.256437164,0]) rotate([90, 0, 0]) cross_beam("C4 ");
translate([0,-178,10]) rotate([0,30.256437164,0]) rotate([90, 0, 0]) cross_beam("C5 ");
translate([0,-202,10]) rotate([0,-30.256437164,0]) rotate([90, 0, 0]) cross_beam("C6 ");
translate([0,-378,10]) rotate([0,30.256437164,0]) rotate([90, 0, 0]) cross_beam("C7 ");
translate([0,-402,10]) rotate([0,-30.256437164,0]) rotate([90, 0, 0]) cross_beam("C8 ");
//Left
//Hole distance 26,177280225
translate([108,95,577.5]) rotate([28.523118606,0,0]) rotate([90, 0, 90]) cross_beam("C59 ");
//Hole distance 23,005434141
translate([88,85,417.5]) rotate([-42.357454706,0,0]) rotate([90, 0, 90]) cross_beam("C60 ");
//Hole distance 20,838665984
translate([108,300,587.5]) rotate([30.256437164,0,0]) rotate([90, 0, 90]) cross_beam("C41 ");
translate([132,300,587.5]) rotate([-30.256437164,0,0]) rotate([90, 0, 90]) cross_beam("C42 ");
//Hole distance 20,353132437
translate([108,300,427.5]) rotate([27.824096384,0,0]) rotate([90, 0, 90]) cross_beam("C43 ");
translate([132,300,427.5]) rotate([-27.824096384,0,0]) rotate([90, 0, 90]) cross_beam("C44 ");
//Hole distance 25,455844123
translate([132,300,230]) rotate([45,0,0]) rotate([90, 0, 90]) cross_beam("C45 ");
translate([108,300,230]) rotate([-45,0,0]) rotate([90, 0, 90]) cross_beam("C46 ");
//Hole distance 22,803508502
translate([132,300,10]) rotate([37.874983651,0,0]) rotate([90, 0, 90]) cross_beam("C47 ");
translate([108,300,10]) rotate([-37.874983651,0,0]) rotate([90, 0, 90]) cross_beam("C48 ");
//Hole distance 24,413111231
translate([132,110,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C27 ");
translate([108,110,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C28 ");
//Hole distance 24,413111231
translate([132,-90,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C29 ");
translate([108,-90,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C30 ");
//Hole distance 24,413111231
translate([132,-290,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C31 ");
translate([108,-290,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C32 ");
//Right
//Hole distance 26,177280225
translate([-108,95,577.5]) rotate([28.523118606,0,0]) rotate([90, 0, 90]) cross_beam("C57 ");
//Hole distance 23,005434141
translate([-88,85,417.5]) rotate([-42.357454706,0,0]) rotate([90, 0, 90]) cross_beam("C58 ");
//Hole distance 20,838665984
translate([-132,300,587.5]) rotate([30.256437164,0,0]) rotate([90, 0, 90]) cross_beam("C49 ");
translate([-108,300,587.5]) rotate([-30.256437164,0,0]) rotate([90, 0, 90]) cross_beam("C50 ");
//Hole distance 20,353132437
translate([-132,300,427.5]) rotate([27.824096384,0,0]) rotate([90, 0, 90]) cross_beam("C51 ");
translate([-108,300,427.5]) rotate([-27.824096384,0,0]) rotate([90, 0, 90]) cross_beam("C52 ");
//Hole distance 25,455844123
translate([-132,300,230]) rotate([45,0,0]) rotate([90, 0, 90]) cross_beam("C53 ");
translate([-108,300,230]) rotate([-45,0,0]) rotate([90, 0, 90]) cross_beam("C54 ");
//Hole distance 22,803508502
translate([-108,300,10]) rotate([37.874983651,0,0]) rotate([90, 0, 90]) cross_beam("C55 ");
translate([-132,300,10]) rotate([-37.874983651,0,0]) rotate([90, 0, 90]) cross_beam("C56 ");
//Hole distance 24,413111231
translate([-108,110,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C21 ");
translate([-132,110,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C22 ");
//Hole distance 24,413111231
translate([-108,-90,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C23 ");
translate([-132,-90,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C24 ");
//Hole distance 24,413111231
translate([-108,-290,10]) rotate([34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C25 ");
translate([-132,-290,10]) rotate([-34.992020199,0,0]) rotate([90, 0, 90]) cross_beam("C26 ");
//Horizontal cross beams
//Hole distance 24,413111231
translate([0,280,692]) rotate([0,0,55.007979801]) rotate([0, 0, -90]) cross_beam("C33 ");
translate([0,280,668]) rotate([0,0,-55.007979801]) rotate([0, 0, 90]) cross_beam("C34 ");
translate([0,280,352]) rotate([0,0,55.007979801]) rotate([0, 0, -90]) cross_beam("C37 ");
translate([0,280,328]) rotate([0,0,-55.007979801]) rotate([0, 0, 90]) cross_beam("C38 ");
//Hole distance 25
translate([0,95,692]) rotate([0,0,53.130102354]) rotate([0, 0, -90]) cross_beam("C35 ");
translate([0,95,668]) rotate([0,0,-53.130102354]) rotate([0, 0, 90]) cross_beam("C36 ");
//Hole distance 26,248809497
translate([0,85,324]) rotate([0,0,49.635463427]) rotate([0, 0, -90]) cross_beam("C39 ");
translate([0,85,328]) rotate([0,0,-49.635463427]) rotate([0, 0, 90]) cross_beam("C40 ");
//Hole distance 28,284271247
translate([0,90,88]) rotate([0,0,45]) rotate([0, 0, -90]) cross_beam("C15 ");
translate([0,90,84]) rotate([0,0,-45]) rotate([0, 0, 90]) cross_beam("C16 ");
translate([0,-110,88]) rotate([0,0,45]) rotate([0, 0, -90]) cross_beam("C17 ");
translate([0,-110,84]) rotate([0,0,-45]) rotate([0, 0, 90]) cross_beam("C18 ");
translate([0,-310,88]) rotate([0,0,45]) rotate([0, 0, -90]) cross_beam("C19 ");
translate([0,-310,84]) rotate([0,0,-45]) rotate([0, 0, 90]) cross_beam("C20 ");
//Bottom
//Hole distance 28,284271247
translate([0,90,-68]) rotate([0,0,45]) rotate([0, 0, 90]) cross_beam("C9 ");
translate([0,90,-92]) rotate([0,0,-45]) rotate([0, 0, -90]) cross_beam("C10 ");
translate([0,-110,-68]) rotate([0,0,45]) rotate([0, 0, 90]) cross_beam("C11 ");
translate([0,-110,-92]) rotate([0,0,-45]) rotate([0, 0, -90]) cross_beam("C12 ");
translate([0,-310,-68]) rotate([0,0,45]) rotate([0, 0, 90]) cross_beam("C13 ");
translate([0,-310,-92]) rotate([0,0,-45]) rotate([0, 0, -90]) cross_beam("C14 ");
}

Dimensions

Framework

Part number Length (mm)
F1 820
F2 820
F3 300
F4 300
F5 300
F6 300
F7 300
F8 220
F9 220
F10 220
F11 220
F12 220
F13 220
F14 260
F15 260
F16 260
F17 260
F18 620
F19 820
F20 820
F21 800
F22 800
F23 800
F24 800
F25 450
F26 430
F27 430
F28 450
F29 430
F30 430
F31 260
F32 260
F33 260
F34 300
F35 260
F36 260
F37 260
F38 380
F39 380
F40 220
F41 220
F42 220
F43 320
F44 260
F45 260
F46 100
F47 260
F48 260
F49 35
F50 260
F51 260
F52 100

Cross beams framework

Part number Length (mm) Hole distance (mm) Center hole diameter (mm)
C1 293 278 5
C2 293 278 7
C3 293 278 5
C4 293 278 7
C5 293 278 5
C6 293 278 7
C7 293 278 5
C8 293 278 7
C9 298 283 5
C10 298 283 7
C11 298 283 5
C12 298 283 7
C13 298 283 5
C14 298 283 7
C15 298 283 7
C16 298 283 7
C17 298 283 7
C18 298 283 7
C19 298 283 7
C20 298 283 7
C21 259 244 5
C22 259 244 7
C23 259 244 5
C24 259 244 7
C25 259 244 5
C26 259 244 7
C27 259 244 7
C28 259 244 5
C29 259 244 7
C30 259 244 5
C31 259 244 7
C32 259 244 5
C33 259 244 7
C34 259 244 5
C35 265 250 7
C36 265 250 5
C37 259 244 5
C38 259 244 7
C39 277 262 7
C40 277 262 5
C41 223 208 5
C42 223 208 7
C43 219 204 5
C44 219 204 7
C45 270 255 7
C46 270 255 5
C47 243 228 7
C48 243 228 5
C49 223 208 7
C50 223 208 5
C51 219 204 7
C52 219 204 5
C53 270 255 7
C54 270 255 5
C55 243 228 5
C56 243 228 7
C57 277 262 -
C58 245 230 -
C59 277 262 -
C60 245 230 -
C61 277 262 5
C62 277 262 7
C63 273 258 5
C64 273 258 7
C65 315 300 5
C66 315 300 7
C67 303 288 7
C68 303 288 5
C69 295 280 7
C70 295 280 5

X Axis

Part number Length (mm)
X1 290
X2 290
X3 330
X4 410
X5 410
X6 105
X7 105
X8 105
X9 105
X10 410
X11 410
X12 370
X13 370
X14 290
X15 290
X16 290
X17 290
X18 290
X19 290
X20 290
X21 290
X22 290

Table beams

Part number Length (mm)
T1 410
T2 410

Y Axis

Part number Length (mm)
Y1 760
Y2 760
Y3 160
Y4 160
Y5 120
Y6 180
Y7 180
Y8 160
Y9 160
Y10 160
Y11 740
Y12 75
Y13 75
Y14 260
Y15 75
Y16 190
Y17 140
Y18 140
Y19 200
Y20 160
Y21 140
Y22 140
Y23 200
Y24 160
Y25 160
Y26 160
Y27 100

Z Axis

Part number Length (mm)
Z1 310
Z2 310
Z3 180
Z4 180
Z5 180
Z6 180
Z7 140
Z8 140
Z9 140
Z10 140
Z11 180
Z12 180
Z13 180
Z14 180
Z15 220
Z16 220

Cutting guide

Steel spuare tubes 20x20x2000mm, 2mm wall tickness

Length tolerance: 5mm
Blade width: 2mm

No. Used length (mm)
1 820 (F1) 820 (F2) 330 (X3) 1976
2 820 (F19) 820 (F20) 320 (F43) 1966
3 800 (F21) 800 (F22) 380 (F38) 1986
4 800 (F23) 800 (F24) 380 (F39) 1986
5 760 (Y1) 760 (Y2) 450 (F25) 1976
6 740 (Y11) 620 (F18) 450 (F28) 160 (Y3) 1978
7 430 (F26) 430 (F27) 430 (F29) 430 (F30) 260 (F14) 1990
8 410 (X4) 410 (X5) 410 (X10) 410 (X11) 310 (Z1) 35 (F49) 1997
9 370 (X12) 370 (X13) 310 (Z2) 300 (F3) 300 (F4) 300 (F5) 1962
10 300 (F6) 300 (F7) 300 (F34) 290 (X1) 290 (X2) 290 (X14) 200 (Y19) 1984
11 290 (X15) 290 (X16) 290 (X17) 290 (X18) 290 (X19) 290 (X20) 220 (F8) 1974
12 290 (X21) 290 (X22) 260 (F15) 260 (F16) 260 (F17) 260 (F31) 260 (F32) 100 (F46) 1996
13 260 (F33) 260 (F35) 260 (F36) 260 (F37) 260 (F44) 260 (F45) 260 (F47) 160 (Y4) 1996
14 260 (F48) 260 (F50) 260 (F51) 260 (Y14) 220 (F9) 220 (F10) 220 (F11) 220 (F12) 1936
15 220 (F13) 220 (F40) 220 (F41) 220 (F42) 220 (Z15) 220 (Z16) 200 (Y23) 190 (Y16) 180 (Y6) 75 (Y12) 1985
16 180 (Y7) 180 (Z3) 180 (Z4) 180 (Z5) 180 (Z6) 180 (Z11) 180 (Z12) 180 (Z13) 180 (Z14) 160 (Y8) 160 (Y9) 1962
17 160 (Y10) 160 (Y20) 160 (Y24) 160 (Y25) 160 (Y26) 140 (Y17) 140 (Y18) 140 (Y21) 140 (Y22) 140 (Z7) 140 (Z8) 140 (Z9) 140 (Z10) 1946
18 120 (Y5) 105 (X6) 105 (X7) 105 (X8) 105 (X9) 100 (F52) 100 (Y27) 75 (Y13) 75 (Y15) 908

Flat iron bars 20x4x2000mm

Length tolerance: 5mm
Blade width: 2mm

No. Used length (mm)
1 410 (T1) 410 (T2) 100 (C1) 100 (C2) 100 (C3) 100 (C4) 100 (C5) 100 (C6) 100 (C7) 100 (C8) 100 (C9) 100 (C10) 100 (C11) 1946
2 100 (C12) 100 (C13) 100 (C14) 100 (C15) 100 (C16) 100 (C17) 100 (C18) 100 (C19) 100 (C20) 100 (C21) 100 (C22) 100 (C23) 100 (C24) 100 (C25) 100 (C26) 100 (C27) 100 (C28) 100 (C29) 100 (C30) 1938
3 100 (C31) 100 (C32) 100 (C33) 100 (C34) 100 (C35) 100 (C36) 100 (C37) 100 (C38) 100 (C39) 100 (C40) 100 (C41) 100 (C42) 100 (C43) 100 (C44) 100 (C45) 100 (C46) 100 (C47) 100 (C48) 100 (C49) 1938
4 100 (C50) 100 (C51) 100 (C52) 100 (C53) 100 (C54) 100 (C55) 100 (C56) 100 (C57) 100 (C58) 100 (C59) 100 (C60) 100 (C61) 100 (C62) 100 (C63) 100 (C64) 100 (C65) 100 (C66) 100 (C67) 100 (C68) 1938
5 100 (C69) 100 (C70) 204

Drill holes

F1 + F2 (820mm)

10 (5) - - - - - 190 (5) - 390 (5) - 590 (5) - 790 (5) -
- 30 (5) 50 (5) 90 (5) 130 (5) 170 (5) - 210 (5) - 410 (5) - 610 (5) - 810 (5)
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -

F3 (300mm)

10 (7) - 50 (5) - - 290 (7)
- 30 (7) - - 270 (7) -
10 (11) - - 250 (5) - 290 (11)
- 30 (11) - - 270 (11) -

F4 + F5 (300mm)

10 (7) - 50 (5) 250 (5) - 290 (7)
- 30 (7) - - 270 (7) -
10 (11) - 50 (5) 250 (5) - 290 (11)
- 30 (11) - - 270 (11) -

F6 (300mm)

10 (7) - 50 (5) 100 (5) 150 (5) 200 (5) 250 (5) - 290 (7)
- 30 (7) - - - - - 270 (7) -
10 (11) - - - - - 250 (5) - 290 (11)
- 30 (11) - - - - - 270 (11) -

F7 + F34 (300mm)

10 (7) - 50 (5) 100 (5) 150 (5) 200 (5) 250 (5) - 290 (7)
- 30 (7) - - - - - 270 (7) -
10 (11) - - - - - - - 290 (11)
- 30 (11) - - - - - 270 (11) -

F8 (220mm)

10 (7) - 50 (5) - 210 (5)
- 30 (5) - 190 (5) 210 (7)
10 (11) - - 190 (5) -
- - 50 (5) - 210 (11)

F9 + F10 (220mm)

10 (7) - 50 (5) 190 (5) 210 (5)
- 30 (5) - 190 (5) 210 (7)
10 (11) - 50 (5) 190 (5) -
- - 50 (5) - 210 (11)

F11 (220mm)

10 (7) - - 190 (5) 210 (5)
- 30 (5) 50 (5) - 210 (7)
10 (11) - 50 (5) - -
- - - 190 (5) 210 (11)

F12 + F13 (220mm)

10 (7) - 50 (5) 190 (5) 210 (5)
- 30 (5) 50 (5) - 210 (7)
10 (11) - 50 (5) 190 (5) -
- - - 190 (5) 210 (11)

F14 (260mm)

- 30 (5) 130 (5) 230 (5) -
10 (5) - - - 250 (5)
- - 130 (5) - -
- - 130 (5) - -

F15 + F16 (260mm)

10 (5) - - - 250 (5)
- 30 (5) - 230 (5) -
10 (5) - - - 250 (5)
- - 130 (5) - -

F17 (260mm)

10 (5) - - - - - - - 250 (5)
- 30 (5) 70 (5) 110 (5) 130 (5) 150 (5) 190 (5) 230 (5) -
10 (5) - - - - - - - 250 (5)
- 30 (5) - - - - - 230 (5) -

F18 (620mm)

10 (7) 110 (5) 210 (7) 310 (5) 410 (7) 510 (5) 610 (7)
- - - - - - -
10 (11) - 210 (11) - 410 (11) - 610 (11)
- - - - - - -

F19 + F20 (820mm)

30 (7) 190 (5) 230 (7) 390 (5) 430 (7) 590 (5) 630 (7) - - - - - 810 (7)
- - - - - - - 650 (5) 690 (5) 730 (5) 770 (5) 790 (5) -
30 (11) - 230 (11) - 430 (11) - 630 (11) - - - - - 810 (11)
- - - - - - - - - - - - -

F21 (800mm)

10 (11) - 50 (5) - - - 215 (5) - - - - - - 550 (5) 590 (5) 610 (5) 750 (5) - 790 (7)
- 30 (5) - - 175 (5) - - - 330 (5) - 370 (5) 515 (5) - - 590 (7) 610 (5) - 770 (5) -
10 (7) - 50 (5) 155 (5) - 195 (5) - 310 (5) - 350 (5) 370 (5) - - - - 610 (5) 750 (5) - 790 (11)
- - - - - - - - - - - - 535 (5) - 590 (11) - 750 (5) - -

F22 (800mm)

10 (11) - - 155 (5) - - - 310 (5) - - - - - 550 (5) 590 (5) 610 (5) 750 (5) - 790 (7)
- 30 (5) - - 175 (5) - - - 330 (5) - 370 (5) 515 (5) - - 590 (7) - 750 (5) 770 (5) -
10 (7) - 50 (5) - - 195 (5) 215 (5) - - 350 (5) 370 (5) - - - - 610 (5) 750 (5) - 790 (11)
- - - - - - - - - - - - 535 (5) - 590 (11) 610 (5) - - -

F23 (800mm)

10 (7) - - 190 (5) 210 (5) - - 430 (5) - - 490 (5) - - - 645 (5) - - 790 (11)
- 30 (5) - - 210 (5) 230 (5) - - - 470 (5) 490 (5) - - 625 (5) 645 (5) - 770 (5) -
10 (11) - 50 (5) - - - 250 (5) - 450 (5) - - 585 (5) 605 (5) - - 750 (5) - 790 (7)
- - 50 (5) - - - 250 (5) 430 (5) - - - 585 (5) - - - 750 (5) - -

F24 (800mm)

10 (7) - 50 (5) - 210 (5) - - 430 (5) - - - 585 (5) - - - 750 (5) - 790 (11)
- 30 (5) 50 (5) - - 230 (5) - - - 470 (5) - 585 (5) - 625 (5) - 750 (5) 770 (5) -
10 (11) - - 190 (5) - - 250 (5) - 450 (5) - 490 (5) - 605 (5) - 645 (5) - - 790 (7)
- - - - 210 (5) - 250 (5) 430 (5) - - 490 (5) - - - 645 (5) - - -

F25 (450mm)

- - - 190 (5) - - 380 (5) 400 (5) - 440 (5)
10 (5) - - 190 (5) - - - - 420 (5) -
- 30 (5) 50 (5) - 210 (5) 230 (5) - 400 (5) - 440 (5)
- - - - - - - - - -

F26 + F29 (430mm)

10 (11) - 190 (11) - 400 (5) -
- 30 (5) - 210 (5) - 420 (11)
10 (7) - 190 (7) - - 420 (5)
- - - - - 420 (7)

F27 (430mm)

10 (7) - - 220 (5) 240 (5) - 400 (5) -
10 (5) - - - 240 (7) - - 420 (7)
10 (11) 30 (5) 200 (5) - - 380 (5) - -
- - 200 (5) - 240 (11) - - 420 (11)

F28 (450mm)

- - 50 (5) - - 230 (5) - 400 (5) - 440 (5)
10 (5) - - 190 (5) - - - - 420 (5) -
- 30 (5) - 190 (5) 210 (5) - 380 (5) 400 (5) - 440 (5)
- - - - - - - - - -

F30 (430mm)

10 (7) - - 220 (5) - 380 (5) 400 (5) -
10 (5) - - - 240 (7) - - 420 (7)
10 (11) 30 (5) 200 (5) - 240 (5) - - -
- - 200 (5) - 240 (11) - - 420 (11)

F31 + F35 (260mm)

10 (7) - - 250 (7)
- 30 (7) 230 (7) -
10 (11) - - 250 (11)
- 30 (11) 230 (11) -

F32 + F33 + F36 + F37 (260mm)

10 (11) - - 250 (11)
- 30 (7) 230 (7) -
10 (7) - - 250 (7)
- 30 (11) 230 (11) -

F38 + F39 (380mm)

10 (7) 50 (5) 125 (5) 165 (7) 185 (5) 220 (5) 260 (5) - 350 (7) -
- - - - - - - 330 (5) - 370 (5)
10 (11) - - 165 (11) - - - - 350 (11) -
- - - - - - - 330 (5) - 370 (5)

F40 + F41 + F42 (220mm)

10 (5) - 210 (5)
- 110 (5) -
10 (5) - 210 (5)
- - -

F43 (320mm)

30 (7) - 145 (7) - 240 (7) -
- - - - - 310 (5)
30 (11) 125 (5) 145 (11) 165 (5) 240 (11) -
- - - - - 310 (5)

F44 (260mm)

10 (7) - - - - - 250 (7)
- 30 (7) - 130 (7) - 230 (7) -
10 (11) - - - - - 250 (11)
- 30 (11) 110 (5) 130 (11) 150 (5) 230 (11) -

F45 + F47 (260mm)

10 (11) - - - 250 (11)
- 30 (7) 130 (7) 230 (7) -
10 (7) - - - 250 (7)
- 30 (11) 130 (11) 230 (11) -

F46 (100mm)

15 (11) 50 (5) 90 (5)
- - -
15 (11) 50 (5) 90 (5)
- - -

F48 (260mm)

10 (7) - - - 250 (7)
- 30 (7) 130 (7) 230 (7) -
10 (11) - - - 250 (11)
- 30 (11) 130 (11) 230 (11) -

F49 (35mm)

10 (11) 25 (5)
- -
10 (11) 25 (5)
- -

F50 (260mm)

10 (7) 130 (11) 250 (7)
- - -
10 (11) 130 (11) 250 (11)
- - -

F51 (260mm)

10 (7) 250 (7)
- -
10 (11) 250 (11)
- -

F52 (100mm)

10 (5) 30 (7) 85 (11)
- - -
- 30 (11) 85 (11)
- - -

X1 (290mm)

10 (11) - - - - - - - - - - - - - - - - 280 (11)
- 30 (7) - 50 (5) - - - - - 145 (11) - - - - 240 (5) - 260 (7) -
10 (7) - - - - - 100 (5) 120 (11) - - - 190 (5) 205 (5) - - - - 280 (7)
- 30 (11) 45 (5) - 65 (5) 85 (5) - - 125 (5) 145 (11) 165 (5) - 205 (5) 225 (5) - 245 (5) 260 (11) -

X2 (290mm)

10 (7) - - - - - 120 (11) - - - 205 (5) - - - - 280 (7)
- 30 (7) - 50 (5) - - - - 145 (11) - - - 240 (5) - 260 (7) -
10 (11) - - - - - - - - - - - - - - 280 (11)
- 30 (11) 45 (5) - 65 (5) 85 (5) - 125 (5) 145 (11) 165 (5) 205 (5) 225 (5) - 245 (5) 260 (11) -

X3 (330mm)

10 (5) 320 (5)
- -
10 (5) 320 (5)
- -

X4 (410mm)

10 (11) - - - - - - - - - - 400 (11)
10 (5) 30 (5) 65 (5) 105 (5) 145 (5) 185 (5) 225 (5) 265 (5) 305 (5) 345 (5) 380 (5) 400 (5)
10 (7) - - - - - - - - - - 400 (7)
- - - - - - - - - - - -

X5 (410mm)

10 (7) - - - - - - - - - - 400 (7)
10 (5) 30 (5) 65 (5) 105 (5) 145 (5) 185 (5) 225 (5) 265 (5) 305 (5) 345 (5) 380 (5) 400 (5)
10 (11) - - - - - - - - - - 400 (11)
- - - - - - - - - - - -

X6 + X8 (105mm)

- 75 (5) -
- - 95 (5)
15 (11) - 95 (5)
- - -

X7 + X9 (105mm)

15 (11) - 95 (5)
- - 95 (5)
- 75 (5) -
- - -

X10 (410mm)

10 (8.5) - - 400 (8.5)
- 50 (5) 360 (5) -
10 (11) - - 400 (11)
- 50 (7) 360 (7) -

X11 (410mm)

10 (11) - - 400 (11)
- 50 (5) 360 (5) -
10 (8.5) - - 400 (8.5)
- 50 (7) 360 (7) -

X12 (370mm)

10 (8.5) - - 360 (8.5)
- 50 (5) 320 (5) -
10 (11) - - 360 (11)
- 50 (7) 320 (7) -

X13 (370mm)

10 (7) - - 360 (7)
- 50 (7) 320 (7) -
10 (7) - - 360 (7)
- 50 (7) 320 (7) -

X14 + X15 + X16 + X17 + X18 + X19 + X20 + X21 + X22 (290mm)

10 (5) 48.57 (5) 87.14 (5) 125.71 (5) 164.29 (5) 202.86 (5) 241.43 (5) 280 (5)
- - - - - - - -
10 (5) - - - - - - 280 (5)
- - - - - - - -

T1 + T2 (410mm)

10 (7) 45 (7) 65 (7) 85 (7) 105 (7) 125 (7) 145 (7) 165 (7) 185 (7) 205 (7) 225 (7) 245 (7) 265 (7) 285 (7) 305 (7) 325 (7) 345 (7) 365 (7) 400 (7)

Y1 (760mm)

30 (5) 180 (7) 220 (5) 270 (5) - 350 (11) - 430 (5) 480 (5) 520 (7) 640 (5) 680 (5) 710 (7) 750 (7)
- - - - 305 (5) - 395 (5) - - - - - - -
- 180 (11) - - - 350 (11) - - - 520 (11) - - 710 (11) 750 (11)
- - - - - - - - - - - - - -

Y2 (760mm)

30 (5) 180 (7) 220 (5) 270 (5) 350 (11) 430 (5) 480 (5) 520 (7) 640 (5) 680 (5) 710 (7) 750 (7)
- - - - - - - - - - - -
- 180 (11) - - 350 (11) - - 520 (11) - - 710 (11) 750 (11)
- - - - - - - - - - - -

Y3 (160mm)

10 (5) - 150 (5)
- 80 (5) -
- 80 (5) -
- 80 (5) -

Y4 + Y8 + Y9 + Y10 (160mm)

10 (5) - 150 (5)
- 80 (5) -
10 (5) - 150 (5)
- - -

Y5 (120mm)

10 (5) - 110 (5)
- 60 (5) -
10 (5) - 110 (5)
- - -

Y6 (180mm)

10 (11) - 70 (5) 90 (11) 110 (5) - 170 (11)
- 65 (11) - - - 150 (5) -
10 (7) - - 90 (11) - - 170 (7)
- - - - - - -

Y7 (180mm)

10 (7) - - 90 (11) - - 170 (7)
- 65 (11) - - - 150 (5) -
10 (11) - 70 (5) 90 (11) 110 (5) - 170 (11)
- - - - - - -

Y11 (740mm)

10 (7) 200 (7) 350 (7) 500 (7) 660 (7) 730 (7)
- - - - - -
10 (11) 200 (11) 350 (11) 500 (11) 660 (11) 730 (11)
- - - - - -

Y12 + Y15 (75mm)

10 (11) 65 (11)
- 65 (5)
10 (7) 65 (7)
- -

Y13 (75mm)

10 (7) 65 (7)
- 65 (5)
10 (11) 65 (11)
- -

Y14 (260mm)

60 (5) 130 (11) 200 (5)
- - -
60 (5) 130 (11) 200 (5)
- - -

Y16 (190mm)

125 (7) 180 (7)
- 180 (5)
125 (11) 180 (11)
- -

Y17 + Y22 (140mm)

10 (11) - -
10 (5) - -
10 (7) 40 (11) 130 (5)
- - -

Y18 + Y21 (140mm)

10 (5) 100 (11) 130 (7)
- - 130 (5)
- - 130 (11)
- - -

Y19 (200mm)

10 (8.5) - - 190 (8.5)
- 50 (5) 150 (5) -
10 (11) - - 190 (11)
- 50 (7) 150 (7) -

Y20 + Y24 (160mm)

10 (7) - - 150 (7)
- 30 (7) 130 (7) -
10 (11) - - 150 (11)
- 30 (7) 130 (7) -

Y23 (200mm)

10 (11) - - 190 (11)
- 50 (5) 150 (5) -
10 (8.5) - - 190 (8.5)
- 50 (7) 150 (7) -

Y25 (160mm)

10 (11) - - 150 (11)
- 50 (5) 110 (5) -
10 (8.5) - - 150 (8.5)
- 50 (7) 110 (7) -

Y26 (160mm)

10 (7) - - 150 (7)
- 50 (7) 110 (7) -
10 (11) - - 150 (11)
- 50 (7) 110 (7) -

Y27 (100mm)

10 (5) 30 (7) 85 (11)
- - -
- 30 (11) 85 (11)
- - -

Z1 (310mm)

10 (7) - 50 (5) 70 (5) - 110 (5) - - 200 (5) - - 240 (5) 260 (5) - 300 (7)
- 30 (5) - - 80 (5) - 130 (5) 180 (5) - - 230 (5) - - 280 (5) -
10 (11) - - - - - - - - - - - - - 300 (11)
- - - - - - 130 (11) - - 220 (5) - - - - -

Z2 (310mm)

10 (11) - - - - - - 155 (11) - - - - - - - 300 (11)
- 30 (5) - - 80 (5) - 130 (5) - 180 (5) - - 230 (5) - - 280 (5) -
10 (7) - 50 (5) 70 (5) - 110 (5) - 155 (11) - 200 (5) - - 240 (5) 260 (5) - 300 (7)
- - - - - 110 (5) 130 (11) - - 200 (5) 220 (5) - - - - -

Z3 + Z4 + Z5 + Z6 (180mm)

10 (5) - - - - 170 (5)
- 20 (5) 66.67 (5) 113.33 (5) 160 (5) -
10 (5) - - - - 170 (5)
- - - - - -

Z7 + Z9 (140mm)

10 (11) - 130 (11)
- - 130 (5)
10 (7) 100 (11) 130 (7)
- - -

Z8 + Z10 (140mm)

10 (7) 100 (11) 130 (7)
- - 130 (5)
10 (11) - 130 (11)
- - -

Z11 + Z12 (180mm)

- 50 (7) 130 (7) -
10 (5) - - 170 (5)
- 50 (7) 130 (7) -
- - - -

Z13 (180mm)

10 (11) - - 170 (11)
- 50 (5) 130 (5) -
10 (8.5) - - 170 (8.5)
- 50 (7) 130 (7) -

Z14 (180mm)

10 (8.5) - - 170 (8.5)
- 50 (5) 130 (5) -
10 (11) - - 170 (11)
- 50 (7) 130 (7) -

Z15 (220mm)

10 (7) - - 210 (7)
- 50 (7) 170 (7) -
10 (11) - - 210 (11)
- 50 (7) 170 (7) -

Z16 (220mm)

10 (11) - - 210 (11)
- 50 (5) 170 (5) -
10 (8.5) - - 210 (8.5)
- 50 (7) 170 (7) -
#!/usr/bin/env python3
# Copyright (c) 2018, 2019 Unrud <unrud@outlook.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import collections
import contextlib
import functools
import itertools
import json
import os
import subprocess
import tempfile
SCAD_FILE = "CNC-v3_2.scad"
# Data is parsed from the last line the OpenSCAD file prints
SCAD_APPENDIX = """;
function cat(L1, L2) = [for (i=[0:len(L1)+len(L2)-1])
i < len(L1)? L1[i] : L2[i-len(L1)]];
echo([
[
["SQUARE_TUBE_WALL_THICKNESS", SQUARE_TUBE_WALL_THICKNESS],
["WITH_CROSS_BEAMS", WITH_CROSS_BEAMS],
["WITH_MOUNTING_PLATES", WITH_MOUNTING_PLATES]
], cat(SQUARE_TUBES, CROSS_BEAMS)]);
"""
SCAD_CMD = "openscad"
SQUARE_TUBE_MATERIAL = {
"title": ("Steel spuare tubes 20x20x2000mm, "
"{SQUARE_TUBE_WALL_THICKNESS}mm wall tickness"),
"length": 2000,
"tolerance": 5,
"blade-width": 2
}
FLAT_MATERIAL = {
"title": "Flat iron bars 20x4x2000mm",
"length": 2000,
"tolerance": 5,
"blade-width": 2
}
BASE_FORMAT = {
"title": "",
"columns": [
{
"title": "Part number",
"value": lambda e: e[0]
},
{
"title": "Length (mm)",
"value": lambda e: fmt_unit(e[1])
}
],
"filter": lambda e, config: False,
"name": lambda e: e[0],
"length": lambda e: e[1],
"drillholes": lambda e, config: [[
x for x in xs if
len(x) < 3 or x[2] == "" or
"C" in x[2] and config["WITH_CROSS_BEAMS"] or
"M" in x[2] and config["WITH_MOUNTING_PLATES"]
] for xs in e[2]],
"material": SQUARE_TUBE_MATERIAL
}
FORMATS = [
{
**BASE_FORMAT,
"title": "Framework",
"filter": lambda e, config: e[0].startswith("F")
},
{
**BASE_FORMAT,
"title": "Cross beams framework",
"columns": BASE_FORMAT["columns"] + [
{
"title": "Hole distance (mm)",
"value": lambda e: fmt_unit(abs(e[2][-1][0] - e[2][0][0]))
},
{
"title": "Center hole diameter (mm)",
"value": lambda e: ("-" if len(e[2]) == 2
else fmt_unit(e[2][1][1]))
}
],
"filter": lambda e, config: (config["WITH_CROSS_BEAMS"] and
e[0].startswith("C")),
"drillholes": lambda e, config: [],
"material": FLAT_MATERIAL
},
{
**BASE_FORMAT,
"title": "X Axis",
"filter": lambda e, config: e[0].startswith("X")
},
{
**BASE_FORMAT,
"title": "Table beams",
"filter": lambda e, config: e[0].startswith("T"),
"drillholes": lambda e, config: [e[2]],
"material": FLAT_MATERIAL
},
{
**BASE_FORMAT,
"title": "Y Axis",
"filter": lambda e, config: e[0].startswith("Y")
},
{
**BASE_FORMAT,
"title": "Z Axis",
"filter": lambda e, config: e[0].startswith("Z")
}
]
def fmt_unit(f):
s = "%.2f" % float(f)
return s.rstrip("0").rstrip(".") if "." in s else s
def normalize_drillholes(drillholes, length):
drillholes = tuple(tuple(sorted((float(e[0]), float(e[1])) for e in s))
for s in drillholes)
rotated_drillholes = [drillholes[i:] + drillholes[:i]
for i in range(len(drillholes))]
reversed_rotated_drillholes = [tuple(tuple(sorted((length - e[0], e[1])
for e in s)) for s in xs)
for xs in rotated_drillholes]
# Sort empty tuples to the end
cmp = lambda a, b: 0 if a == b else (1 if a > b and b or not a else -1)
return max(rotated_drillholes + reversed_rotated_drillholes,
key=lambda x: tuple(reversed(list(map(functools.cmp_to_key(cmp),
x)))))
Key = collections.namedtuple("Key", ["format_id", "length", "norm_drillholes"])
def make_key(_format, drillholes, length):
length = float(length)
drillholes = normalize_drillholes(drillholes, length)
return Key(id(_format), length, drillholes)
def main():
with contextlib.ExitStack() as stack:
with open(SCAD_FILE) as f, tempfile.NamedTemporaryFile(
"w", prefix=".tmp-", suffix=os.path.splitext(SCAD_FILE)[1],
dir=os.path.dirname(SCAD_FILE), delete=False) as temp_scad:
stack.callback(os.remove, temp_scad.name)
temp_scad.write(f.read())
temp_scad.write(SCAD_APPENDIX)
with tempfile.NamedTemporaryFile(
prefix=".tmp-", suffix=".echo",
dir=os.path.dirname(SCAD_FILE), delete=False) as temp_echo:
stack.callback(os.remove, temp_echo.name)
subprocess.run([SCAD_CMD, "-o", temp_echo.name, temp_scad.name])
with open(temp_echo.name) as f:
echo_lines = [l[len("ECHO: "):] for l in f.readlines()
if l.startswith("ECHO: ")]
config, entries = json.loads(echo_lines[-1])
config = dict(config)
print("# Dimensions")
drillhole_buckets = collections.OrderedDict()
materials = collections.OrderedDict()
for f in FORMATS:
filtered_entries = [e for e in entries if f["filter"](e, config)]
if not filtered_entries:
continue
print("\n## %s\n" % f["title"])
for c in f["columns"]:
print("| %s " % c["title"], end="")
print("|")
for c in f["columns"]:
print("|-", end="")
print("|")
for e in filtered_entries:
for c in f["columns"]:
print("| %s " % c["value"](e), end="")
print("|")
name = f["name"](e)
drillholes = f["drillholes"](e, config)
if drillholes:
key = make_key(f, drillholes, f["length"](e))
if key not in drillhole_buckets:
drillhole_buckets[key] = []
drillhole_buckets[key].append(name)
if f.get("material"):
if id(f["material"]) not in materials:
materials[id(f["material"])] = (f["material"], [])
materials[id(f["material"])][1].append((name, key.length))
print("\n# Cutting guide")
for m, lengths in materials.values():
lengths = sorted(reversed(lengths), key=lambda x: x[1])
print("\n## %s\n" % m["title"].format(**config))
print("Length tolerance: %smm " % fmt_unit(m["tolerance"]))
print("Blade width: %smm \n" % fmt_unit(m["blade-width"]))
cuts = []
while lengths:
cuts.append([])
sum_length = 0
for i, (_, l) in reversed(list(enumerate(lengths))):
if sum_length + l <= m["length"] - m["tolerance"]:
sum_length += l + m["blade-width"]
cuts[-1].append(lengths.pop(i))
columns = max(map(len, cuts))
print("| No. ", end="")
for _ in range(columns):
print("| ", end="")
print("| Used length (mm) ", end="")
print("|")
for _ in range(columns + 2):
print("|-", end="")
print("|")
for i, cut in enumerate(cuts):
print("| %d " % (i + 1), end="")
for n, l in cut:
print("| %s (%s) " % (fmt_unit(l), n), end="")
for _ in range(columns - len(cut)):
print("| ", end="")
print("| %s " % fmt_unit(min(
sum(map(lambda x: x[1], cut)) + len(cut) * m["blade-width"],
m["length"])), end="")
print("|")
print("\n# Drill holes")
for key, names in drillhole_buckets.items():
if not key.norm_drillholes:
continue
title = " + ".join(names)
print("\n## %s (%smm)\n" % (title, fmt_unit(key.length)))
slots = sorted(
{e[0] for e in itertools.chain.from_iterable(key.norm_drillholes)})
for _ in slots:
print("| ", end="")
print("|")
for _ in slots:
print("|-", end="")
print("|")
for xs in key.norm_drillholes:
for p in slots:
for s in xs:
if s[0] == p:
print("| %s (%s) " % (fmt_unit(s[0]), fmt_unit(s[1])),
end="")
break
else:
print("| - ", end="")
print("|")
if __name__ == "__main__":
main()
@ameuret
Copy link

ameuret commented Nov 28, 2019

Fantastic ! Thanks for sharing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment